ying09 / TextFuseNet

A PyTorch implementation of "TextFuseNet: Scene Text Detection with Richer Fused Features".
MIT License
476 stars 123 forks source link

TypeError: cannot unpack non-iterable VisImage object #84

Open dadizak opened 2 years ago

dadizak commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

pip uninstall detectron2

conda uninstall detectron2

in TextFuseNet folder:

python setup.py install

pip install fvcore-master.zip

Hegelim commented 1 year ago

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