Skip to content

[Bug]  #2069

@azhadzuraimi

Description

@azhadzuraimi

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions