@@ -67,10 +67,10 @@ def __init__(self,
6767 [[1 , 1 ], [1 , 1 ]])
6868
6969 def polygons_from_bitmap (self , pred , _bitmap , dest_width , dest_height ):
70- '''
70+ """
7171 _bitmap: single map with shape (1, H, W),
7272 whose values are binarized as {0, 1}
73- '''
73+ """
7474
7575 bitmap = _bitmap
7676 height , width = bitmap .shape
@@ -114,10 +114,10 @@ def polygons_from_bitmap(self, pred, _bitmap, dest_width, dest_height):
114114 return boxes , scores
115115
116116 def boxes_from_bitmap (self , pred , _bitmap , dest_width , dest_height ):
117- '''
117+ """
118118 _bitmap: single map with shape (1, H, W),
119119 whose values are binarized as {0, 1}
120- '''
120+ """
121121
122122 bitmap = _bitmap
123123 height , width = bitmap .shape
@@ -192,9 +192,9 @@ def get_mini_boxes(self, contour):
192192 return box , min (bounding_box [1 ])
193193
194194 def box_score_fast (self , bitmap , _box ):
195- '''
195+ """
196196 box_score_fast: use bbox mean score as the mean score
197- '''
197+ """
198198 h , w = bitmap .shape [:2 ]
199199 box = _box .copy ()
200200 xmin = np .clip (np .floor (box [:, 0 ].min ()).astype ("int32" ), 0 , w - 1 )
@@ -209,9 +209,9 @@ def box_score_fast(self, bitmap, _box):
209209 return cv2 .mean (bitmap [ymin :ymax + 1 , xmin :xmax + 1 ], mask )[0 ]
210210
211211 def box_score_slow (self , bitmap , contour ):
212- '''
213- box_score_slow: use polyon mean score as the mean score
214- '''
212+ """
213+ box_score_slow: use polygon mean score as the mean score
214+ """
215215 h , w = bitmap .shape [:2 ]
216216 contour = contour .copy ()
217217 contour = np .reshape (contour , (- 1 , 2 ))
0 commit comments