Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] #2069

Open
2 tasks done
azhadzuraimi opened this issue Oct 23, 2024 · 0 comments
Open
2 tasks done

[Bug] #2069

azhadzuraimi opened this issue Oct 23, 2024 · 0 comments
Assignees

Comments

@azhadzuraimi
Copy link

azhadzuraimi commented Oct 23, 2024

Prerequisite

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
image

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

image

Reproduces the problem - error message

I tried referencing using this image
30 06 2024_140

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants