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

TypeError: cannot unpack non-iterable VisImage object #84

Open
dadizak opened this issue Dec 1, 2021 · 3 comments
Open

TypeError: cannot unpack non-iterable VisImage object #84

dadizak opened this issue Dec 1, 2021 · 3 comments

Comments

@dadizak
Copy link

dadizak commented Dec 1, 2021

thanks for this work,i'm very gratefuly to help me to fix this error:
Traceback (most recent call last):
File "/content/TextFuseNet/demo/icdar2015_detection.py", line 135, in
prediction, vis_output, polygons = detection_demo.run_on_image(img)
File "/content/TextFuseNet/demo/predictor.py", line 64, in run_on_image
vis_output, polygons = visualizer.draw_instance_predictions(predictions=instances)
TypeError: cannot unpack non-iterable VisImage object

@mwolf2
Copy link

mwolf2 commented Dec 2, 2021

Hi, I encountered the same error running icdar2015_detection.py. I suspect it might be something to do with the fact that I am not running TextFuseNet-Detectron due to CUDA 10.1 being incompatible with my GPU but here's the fix that is working for me right now:

In icdar2015_detection.py, change line 135 from
prediction, vis_output, polygons = detection_demo.run_on_image(img)
to
prediction, vis_output = detection_demo.run_on_image(img)
and comment out line 139.

Then, in predictor.py, change line 64 from
vis_output,polygons = visualizer.draw_instance_predictions(predictions=instances)
to
vis_output = visualizer.draw_instance_predictions(predictions=instances)
and comment out , polygons in line 66.

My guess is that their TextFuseNet-detectron's visualizer function works differently than the one in stock Detectron2. Hope this helps.

@angrylau
Copy link

angrylau commented May 6, 2023

pip uninstall detectron2

conda uninstall detectron2

in TextFuseNet folder:

python setup.py install

pip install fvcore-master.zip

@Hegelim
Copy link

Hegelim commented Oct 16, 2023

Hi, I encountered the same error running icdar2015_detection.py. I suspect it might be something to do with the fact that I am not running TextFuseNet-Detectron due to CUDA 10.1 being incompatible with my GPU but here's the fix that is working for me right now:

In icdar2015_detection.py, change line 135 from prediction, vis_output, polygons = detection_demo.run_on_image(img) to prediction, vis_output = detection_demo.run_on_image(img) and comment out line 139.

Then, in predictor.py, change line 64 from vis_output,polygons = visualizer.draw_instance_predictions(predictions=instances) to vis_output = visualizer.draw_instance_predictions(predictions=instances) and comment out , polygons in line 66.

My guess is that their TextFuseNet-detectron's visualizer function works differently than the one in stock Detectron2. Hope this helps.

There would still be problems in save_result_to_txt as it takes in polygons as an argument

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

4 participants