|
|
@ -63,6 +63,7 @@ class TextDetector(object):
|
|
|
|
postprocess_params["box_thresh"] = args.det_db_box_thresh
|
|
|
|
postprocess_params["box_thresh"] = args.det_db_box_thresh
|
|
|
|
postprocess_params["max_candidates"] = 1000
|
|
|
|
postprocess_params["max_candidates"] = 1000
|
|
|
|
postprocess_params["unclip_ratio"] = args.det_db_unclip_ratio
|
|
|
|
postprocess_params["unclip_ratio"] = args.det_db_unclip_ratio
|
|
|
|
|
|
|
|
postprocess_params["use_dilation"] = True
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
logger.info("unknown det_algorithm:{}".format(self.det_algorithm))
|
|
|
|
logger.info("unknown det_algorithm:{}".format(self.det_algorithm))
|
|
|
|
sys.exit(0)
|
|
|
|
sys.exit(0)
|
|
|
@ -111,7 +112,7 @@ class TextDetector(object):
|
|
|
|
box = self.clip_det_res(box, img_height, img_width)
|
|
|
|
box = self.clip_det_res(box, img_height, img_width)
|
|
|
|
rect_width = int(np.linalg.norm(box[0] - box[1]))
|
|
|
|
rect_width = int(np.linalg.norm(box[0] - box[1]))
|
|
|
|
rect_height = int(np.linalg.norm(box[0] - box[3]))
|
|
|
|
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
|
|
|
|
continue
|
|
|
|
dt_boxes_new.append(box)
|
|
|
|
dt_boxes_new.append(box)
|
|
|
|
dt_boxes = np.array(dt_boxes_new)
|
|
|
|
dt_boxes = np.array(dt_boxes_new)
|
|
|
|