Open antoniolanza1996 opened 3 years ago
@antoniolanza1996 here you mentioned above is for text recognition, but the config in the title of issue is from text detection. Why does panet_r18_fpem_ffm_600e_icdar2015.py
use ResizeOCR
? Any thing wrong?
Hi @cuhk-hbsun ,
actually I'm working with demo/ocr_image_demo.py
script using panet_r18_fpem_ffm_600e_icdar2015
as text detector and robustscanner_r31_academic
as text recognizer and I get the error mentioned above.
If I only switch the text detector (e.g. using psenet_r50_fpnf_600e_icdar2015
), this problem doesn't come up. Hence I though that panet_r18_fpem_ffm_600e_icdar2015
predicts some erroneous bounding boxes (e.g. with width=0). Indeed, if I add this simple check after this line of code:
height,width = box_img.shape[:2]
if height==0 or width==0:
continue
I skip these erroneous predictions and everything is alright in text recognition step.
I see two possible solutions here:
demo/ocr_image_demo.py
scriptmodel_inference
API here (more robust and generalizable, i guess).
Describe the bug If I print
results
variable here, I obtain:Hence I guess this text detection prediction with height=0 breaks the whole pipeline. How can I filter out this erroneous prediction?
Environment
Error traceback