Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1402 from MissPenguin/dygraph
Browse files Browse the repository at this point in the history
fix predict_det
  • Loading branch information
MissPenguin committed Dec 13, 2020
2 parents d7f5365 + edc0fd0 commit 52671b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ppocr/postprocess/db_postprocess.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self,
self.max_candidates = max_candidates
self.unclip_ratio = unclip_ratio
self.min_size = 3
self.dilation_kernel = None if not use_dilation else [[1, 1], [1, 1]]
self.dilation_kernel = None if not use_dilation else np.array([[1, 1], [1, 1]])

def boxes_from_bitmap(self, pred, _bitmap, dest_width, dest_height):
'''
Expand Down
3 changes: 2 additions & 1 deletion tools/infer/predict_det.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(self, args):
postprocess_params["box_thresh"] = args.det_db_box_thresh
postprocess_params["max_candidates"] = 1000
postprocess_params["unclip_ratio"] = args.det_db_unclip_ratio
postprocess_params["use_dilation"] = True
else:
logger.info("unknown det_algorithm:{}".format(self.det_algorithm))
sys.exit(0)
Expand Down Expand Up @@ -111,7 +112,7 @@ def filter_tag_det_res(self, dt_boxes, image_shape):
box = self.clip_det_res(box, img_height, img_width)
rect_width = int(np.linalg.norm(box[0] - box[1]))
rect_height = int(np.linalg.norm(box[0] - box[3]))
if rect_width <= 10 or rect_height <= 10:
if rect_width <= 3 or rect_height <= 3:
continue
dt_boxes_new.append(box)
dt_boxes = np.array(dt_boxes_new)
Expand Down

0 comments on commit 52671b7

Please sign in to comment.