-
Notifications
You must be signed in to change notification settings - Fork 773
Description
Prerequisite
- I have searched Issues and Discussions but cannot get the expected help.
- The bug has not been fixed in the latest version (0.x) or latest version (1.x).
Task
I have modified the scripts/configs, or I'm working on my own tasks/models/datasets.
Branch
main branch https://github.com/open-mmlab/mmocr
Environment
no problem
Reproduces the problem - code sample
File "C:\Users\mimos6997\miniconda3\envs\meterDetection\lib\site-packages\mmcv\transforms\processing.py", line 185, in _resize_img
File "C:\Users\mimos6997\miniconda3\envs\meterDetection\lib\site-packages\mmcv\image\geometric.py", line 126, in imresize
h_scale = size[1] / h
ZeroDivisionError: division by zero
Reproduces the problem - command or script
I try inference using svtr model and PanetCTW but got an error divide by zero in w
so I updated the code inside geometric.py from imresize function to change 0 to 1 from variable h. It resolve the problem, however I want to know is there any issues if I change this code.
##code added
h, w = img.shape[:2]
if h==0:
h=1
if w==0:
w=1
Reproduces the problem - error message
I tried referencing using this image
Additional information
No response