mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-11-15 17:43:39 +00:00
add drop_score to args
This commit is contained in:
parent
e696c7906d
commit
a804a97c92
@ -71,6 +71,7 @@ def parse_args():
|
|||||||
parser.add_argument("--use_space_char", type=str2bool, default=True)
|
parser.add_argument("--use_space_char", type=str2bool, default=True)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--vis_font_path", type=str, default="./doc/simfang.ttf")
|
"--vis_font_path", type=str, default="./doc/simfang.ttf")
|
||||||
|
parser.add_argument("--drop_score", type=float, default=0.5)
|
||||||
|
|
||||||
# params for text classifier
|
# params for text classifier
|
||||||
parser.add_argument("--use_angle_cls", type=str2bool, default=False)
|
parser.add_argument("--use_angle_cls", type=str2bool, default=False)
|
||||||
@ -229,10 +230,10 @@ def draw_ocr_box_txt(image,
|
|||||||
box[2][1], box[3][0], box[3][1]
|
box[2][1], box[3][0], box[3][1]
|
||||||
],
|
],
|
||||||
outline=color)
|
outline=color)
|
||||||
box_height = math.sqrt((box[0][0] - box[3][0])**2 + (box[0][1] - box[3][
|
box_height = math.sqrt((box[0][0] - box[3][0]) ** 2 + (box[0][1] - box[3][
|
||||||
1])**2)
|
1]) ** 2)
|
||||||
box_width = math.sqrt((box[0][0] - box[1][0])**2 + (box[0][1] - box[1][
|
box_width = math.sqrt((box[0][0] - box[1][0]) ** 2 + (box[0][1] - box[1][
|
||||||
1])**2)
|
1]) ** 2)
|
||||||
if box_height > 2 * box_width:
|
if box_height > 2 * box_width:
|
||||||
font_size = max(int(box_width * 0.9), 10)
|
font_size = max(int(box_width * 0.9), 10)
|
||||||
font = ImageFont.truetype(font_path, font_size, encoding="utf-8")
|
font = ImageFont.truetype(font_path, font_size, encoding="utf-8")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user