@@ -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
0 commit comments