Skip to content

Commit c1c6598

Browse files
committed
rank_tag 수정시 발생한 오타 수정
1 parent ef02203 commit c1c6598

File tree

13 files changed

+34
-34
lines changed

13 files changed

+34
-34
lines changed

ai/OZEngine/dress_checkers/NavyServiceUniformChecker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self, train_mode):
1414
'lower': (30, 20, 0),
1515
'upper': (255, 255, 255)
1616
},
17-
'rank_tag: {
17+
"rank_tag": {
1818
'lower': (0, 150, 90),
1919
'upper': (255, 255, 255)
2020
}
@@ -31,7 +31,7 @@ def isNameTag(self, contour, position, kind):
3131
return position == 'left' and kind == 'name_tag'
3232

3333
def isClassTag(self, contour, position, kind):
34-
return position == 'right' and kind == 'rank_tag
34+
return position == 'right' and kind == "rank_tag"
3535

3636
def isInShirt(self, contour):
3737
# 샘브레이 영영 안쪽 && 모서리가 4~5 && 크기가 {hyperParameter} 이상 => (이름표 or 계급장)
@@ -49,10 +49,10 @@ def checkUniform(self, org_img):
4949

5050
# 이름표, 계급장 체크
5151
for i, (contour, lev) in enumerate(zip(contours, hierarchy)):
52-
is_rank_tag= self.result_dic['component'].get('rrank_tag
52+
is_rank_tag= self.result_dic['component'].get('rank_tag')
5353
is_name_tag = self.result_dic['component'].get('name_tag')
5454

55-
if is_name_tag and is_rank_tag
55+
if is_name_tag and is_rank_tag:
5656
break
5757

5858
cur_node, next_node, prev_node, first_child, parent = lev
@@ -91,14 +91,14 @@ def checkUniform(self, org_img):
9191
self.result_dic['component']['name_tag'] = component
9292

9393
# 계급장 체크
94-
elif not is_rank_tagand self.isClassTag(contour, position, kind):
94+
elif not is_rank_tag and self.isClassTag(contour, position, kind):
9595
box_position, component, masked_img = self.getClasses(
9696
img, hsv_img, contour)
9797

9898
# return값에 반영
99-
self.result_dic['box_position']['rank_tag] = box_position
100-
self.result_dic['component']['rank_tag] = component
101-
self.result_dic['masked_img']['rank_tag] = masked_img
99+
self.result_dic['box_position']["rank_tag"] = box_position
100+
self.result_dic['component']["rank_tag"] = component
101+
self.result_dic['masked_img']["rank_tag"] = masked_img
102102

103103

104104
return self.result_dic

ai/OZEngine/dress_checkers/UniformChecker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def getClasses(self, img, hsv_img, contour):
110110
hsv_roi = hsv_img[y:y+h, x:x+w]
111111

112112
contours, masked_img = self.getMaskedContours(
113-
img=roi, hsv_img=hsv_roi, kind='rank_tag)
113+
img=roi, hsv_img=hsv_roi, kind="rank_tag")
114114

115115
classes_n = 0
116116
for contour in contours:

ai/worker/manager/image_box.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def image_process(self, image):
7575

7676
self.is_update = True
7777
# 계급장이 있으면
78-
if report['component'].get("rank_tag) and self.inspection['rank'] == 1:
78+
if report['component'].get("rank_tag") and self.inspection['rank'] == 1:
7979
# 계급 인식
80-
self.inspection['rank'] = DB_TABLE["rank"].get(report['component'].get("rank_tag))
80+
self.inspection['rank'] = DB_TABLE["rank"].get(report['component'].get("rank_tag"))
8181
self.is_update = True
8282

8383

ai/worker/manager/table_list.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"군복" : "육군",
3939
}
4040
UNIFORM_PARTS = {
41-
2 : [ "name_tag", "rank_tag ], # 샘당
42-
3 : [ "name_tag", "rank_tag, "muffler", "neck" ], # 정복
43-
4 : [ "name_tag", "rank_tag, "flag" ], # 군복
41+
2 : [ "name_tag", "rank_tag" ], # 샘당
42+
3 : [ "name_tag", "rank_tag", "muffler", "neck" ], # 정복
43+
4 : [ "name_tag", "rank_tag", "flag" ], # 군복
4444
}

ai/worker/manager/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
PART_ID = {
2222
"hair": 1,
2323
"name_tag": 2,
24-
"rank_tag: 3,
24+
"rank_tag": 3,
2525
"flag": 4,
2626
"cap": 5,
2727
"muffler": 6,

ai/worker/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
PART_ID = {
2828
"hair": 1,
2929
"name_tag": 2,
30-
"rank_tag: 3,
30+
"rank_tag": 3,
3131
"flag": 4,
3232
"cap": 5,
3333
"muffler": 6,

webrtc/backend/src/app/api/image_box/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
UNIFORM_PARTS = {
3-
'blue' : [ "hair", "name_tag", "rank_tag ], # 샘당
4-
'black' : [ "hair", "name_tag", "rank_tag, "muffler", "neckerchief" ], # 정복
5-
'green' : [ "hair", "name_tag", "rank_tag, "flag" ], # 군복
3+
'blue' : [ "hair", "name_tag", "rank_tag" ], # 샘당
4+
'black' : [ "hair", "name_tag", "rank_tag", "muffler", "neckerchief" ], # 정복
5+
'green' : [ "hair", "name_tag", "rank_tag", "flag" ], # 군복
66
}
77

88
AFFILIATION_TABLE = {

webrtc/backend/src/app/api/image_box/db_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
PART_ID = {
2222
"hair": 1,
2323
"name_tag": 2,
24-
"rank_tag: 3,
24+
"rank_tag": 3,
2525
"flag": 4,
2626
"cap": 5,
2727
"muffler": 6,
@@ -32,7 +32,7 @@
3232
3333
"두발" : 1, # "두발"
3434
"name_tag" : 2, # "이름표" :
35-
"rank_tag : 3, # "계급장" : 3,
35+
"rank_tag" : 3, # "계급장" : 3,
3636
"flag" : 4, #"태극기" : 4,
3737
"모자" : 5, #"모자" : 5,
3838
"neckerchief" : 6, # "네커치프" : 6,

webrtc/backend/src/app/api/image_box/front_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
PART_NAME = {
3-
'rank_tag : 'leveltag',
3+
'rank_tag' : 'leveltag',
44
'name_tag' : 'nametag',
55
'neckerchief' : 'neck',
66
'uniform' : 'kind',

webrtc/backend/src/app/api/simple/image_box.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
"군복" : "육군",
3939
}
4040
UNIFORM_PARTS = {
41-
2 : [ "name_tag", "rank_tag ], # 샘당
42-
3 : [ "name_tag", "rank_tag, "muffler", "neck" ], # 정복
43-
4 : [ "name_tag", "rank_tag, "flag" ], # 군복
41+
2 : [ "name_tag", "rank_tag" ], # 샘당
42+
3 : [ "name_tag", "rank_tag", "muffler", "neck" ], # 정복
43+
4 : [ "name_tag", "rank_tag", "flag" ], # 군복
4444
}
4545

4646
class ImageBox:
@@ -118,9 +118,9 @@ def image_process(self, image):
118118

119119
self.is_update = True
120120
# 계급장이 있으면
121-
if report['component'].get("rank_tag) and self.inspection['rank'] == 1:
121+
if report['component'].get("rank_tag") and self.inspection['rank'] == 1:
122122
# 계급 인식
123-
self.inspection['rank'] = DB_TABLE["rank"].get(report['component'].get("rank_tag))
123+
self.inspection['rank'] = DB_TABLE["rank"].get(report['component'].get("rank_tag"))
124124
self.is_update = True
125125

126126

0 commit comments

Comments
 (0)