mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-11-14 00:54:02 +00:00
update vis
This commit is contained in:
parent
ba284a2b74
commit
444080a0cd
@ -37,6 +37,7 @@ from ppocr.postprocess import build_post_process
|
|||||||
from ppocr.utils.save_load import load_model
|
from ppocr.utils.save_load import load_model
|
||||||
from ppocr.utils.utility import get_image_file_list
|
from ppocr.utils.utility import get_image_file_list
|
||||||
from ppocr.utils.visual import draw_rectangle
|
from ppocr.utils.visual import draw_rectangle
|
||||||
|
from tools.infer.utility import draw_boxes
|
||||||
import tools.program as program
|
import tools.program as program
|
||||||
import cv2
|
import cv2
|
||||||
|
|
||||||
@ -105,9 +106,13 @@ def main(config, device, logger, vdl_writer):
|
|||||||
f_w.write("result: {}, {}\n".format(structure_str_list,
|
f_w.write("result: {}, {}\n".format(structure_str_list,
|
||||||
bbox_list_str))
|
bbox_list_str))
|
||||||
|
|
||||||
|
if len(bbox_list) > 0 and len(bbox_list[0]) == 4:
|
||||||
img = draw_rectangle(file, bbox_list)
|
img = draw_rectangle(file, bbox_list)
|
||||||
|
else:
|
||||||
|
img = draw_boxes(cv2.imread(file), bbox_list)
|
||||||
cv2.imwrite(
|
cv2.imwrite(
|
||||||
os.path.join(save_res_path, os.path.basename(file)), img)
|
os.path.join(save_res_path, os.path.basename(file)), img)
|
||||||
|
logger.info('save result to {}'.format(save_res_path))
|
||||||
logger.info("success!")
|
logger.info("success!")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user