text-detection icon indicating copy to clipboard operation
text-detection copied to clipboard

Getting TypeError

Open jasim-ak opened this issue 1 year ago • 3 comments

Command ran: python detect.py -i input_scenetext01.jpg

Output:

[================================================================] 1524 of 1524 0 regions left. Traceback (most recent call last): File "C:\Workspaces\Python\text-detection\src\detect.py", line 41, in res = td.detect() File "C:\Workspaces\Python\text-detection\src\lib\text_detection.py", line 280, in detect for i, (contour, hierarchy) in enumerate(zip(contours, hierarchies[0])): TypeError: 'NoneType' object is not subscriptable

requirements ( pip freeze ):

contourpy==1.2.0 cycler==0.12.1 fonttools==4.47.0 importlib-resources==6.1.1 kiwisolver==1.4.5 matplotlib==3.8.2 numpy==1.26.3 opencv-python==4.9.0.80 packaging==23.2 pillow==10.2.0 progressbar==2.5 pyparsing==3.1.1 pytesseract==0.3.10 python-dateutil==2.8.2 scipy==1.11.4 six==1.16.0 zipp==3.17.0

jasim-ak avatar Jan 05 '24 06:01 jasim-ak

I made an update in https://github.com/azmiozgen/text-detection/commit/5d499511e8693a95c52d064b206f40aa5f1de9ce to handle NoneType hierarchy. Could you check please?

azmiozgen avatar Jan 08 '24 11:01 azmiozgen

@azmiozgen, not able to see the updates.

jasim-ak avatar Jan 09 '24 03:01 jasim-ak

I made an update on master branch. Did you pull the last commit?

azmiozgen avatar Jan 11 '24 06:01 azmiozgen