mirror of
https://github.com/open-mmlab/mmocr.git
synced 2025-06-03 21:54:47 +08:00
[Fix] Totaltext_converter: skip invalid annotations (#438)
* [Fix] Skip invalid annoataions
This commit is contained in:
parent
8f377f2fa2
commit
d683b14283
@ -295,6 +295,11 @@ def generate_ann(root_path, split, image_infos):
|
|||||||
for anno in image_info['anno_info']:
|
for anno in image_info['anno_info']:
|
||||||
word = anno['word']
|
word = anno['word']
|
||||||
dst_img = crop_img(image, anno['bbox'])
|
dst_img = crop_img(image, anno['bbox'])
|
||||||
|
|
||||||
|
# Skip invalid annotations
|
||||||
|
if min(dst_img.shape) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
dst_img_name = f'{src_img_root}_{index}.png'
|
dst_img_name = f'{src_img_root}_{index}.png'
|
||||||
index += 1
|
index += 1
|
||||||
dst_img_path = osp.join(dst_image_root, dst_img_name)
|
dst_img_path = osp.join(dst_image_root, dst_img_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user