Skip to content

Commit

Permalink
Update python/test_demo
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Aug 17, 2022
1 parent 1116476 commit afb6bb5
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions python/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,10 @@ def visualize(image_path, boxes, rec_res, font_path="resources/fonts/FZYTK.TTF")
if __name__ == '__main__':
text_sys = TextSystem('config.yaml')

from tqdm import tqdm
img_list = list(Path('tmp_images').iterdir())
for image_path in tqdm(img_list):
image_path = str(image_path)
print(image_path)
# image_path = r'test_images/ch_en_num.jpg'
img = cv2.imread(image_path)
dt_boxes, rec_res = text_sys(img)
# print(rec_res)

# visualize(image_path, dt_boxes, rec_res,
# font_path='resources/fonts/FZYTK.TTF')
image_path = r'test_images/ch_en_num.jpg'
img = cv2.imread(image_path)
dt_boxes, rec_res = text_sys(img)
print(rec_res)

visualize(image_path, dt_boxes, rec_res,
font_path='resources/fonts/msyh.ttc')

0 comments on commit afb6bb5

Please sign in to comment.