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

instance segmentation test does not work with "--show" #6

Closed
betogulliver opened this issue Jun 30, 2020 · 2 comments
Closed

instance segmentation test does not work with "--show" #6

betogulliver opened this issue Jun 30, 2020 · 2 comments

Comments

@betogulliver
Copy link

betogulliver commented Jun 30, 2020

Thanks for sharing your research/code with us. Much appreciated.

I tried to run the "instance segmentation" test with "--show" but it fails on my setup (see below for details).
"instance segmentaion" test with "--eval segm" works OK though.
Any ideas?

python tools/test.py configs/D2Det/D2Det_instance_r101_fpn_2x.py      checkpoints/D2Det-instance-res101.pth      --show

  File ".../code/01-D2Det/mmdet/models/detectors/base.py", line 178, in show_result
    img_show[mask] = img_show[mask] * 0.5 + color_mask * 0.5
IndexError: boolean index did not match indexed array along dimension 0; dimension is 800 but corresponding boolean dimension is 427
(01-D2Det) gpu_server% 


---------------------------------------------------------------------
NG
(01-D2Det) gpu_server%  python tools/test.py configs/D2Det/D2Det_instance_r101_fpn_2x.py      checkpoints/D2Det-instance-res101.pth      --show
---------------------------------------------------------------------
loading annotations into memory...
Done (t=0.64s)
creating index...
index created!
[                                                  ] 0/5000, elapsed: 0s, ETA:
(427, 640, 3) (800, 1199, 3) (1, 3)
Traceback (most recent call last):
  File "tools/test.py", line 175, in <module>
    main()
  File "tools/test.py", line 153, in main
    outputs = single_gpu_test(model, data_loader, args.show)
  File ".../code/01-D2Det/mmdet/apis/test.py", line 23, in single_gpu_test
    model.module.show_result(data, result)
  File ".../code/01-D2Det/mmdet/models/detectors/base.py", line 178, in show_result
    img_show[mask] = img_show[mask] * 0.5 + color_mask * 0.5
IndexError: boolean index did not match indexed array along dimension 0; dimension is 800 but corresponding boolean dimension is 427
(01-D2Det) gpu_server% 
----------------------------------------------------------------------

----------------------------------------------------------------------
OK 
(01-D2Det) gpu-server%  python tools/test.py configs/D2Det/D2Det_instance_r101_fpn_2x.py      checkpoints/D2Det-instance-res101.pth --eval segm
----------------------------------------------------------------------
loading annotations into memory...
Done (t=0.64s)
creating index...
index created!
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 5000/5000, 8.3 task/s, elapsed: 603s, ETA:     0s
Evaluating segm...
Loading and preparing results...
DONE (t=1.35s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *segm*
DONE (t=32.53s).
Accumulating evaluation results...
DONE (t=3.37s).
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.397
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.604
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.431
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.224
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.435
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.546
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.322
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.493
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.513
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.314
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.550
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.682
(01-D2Det) gpu_server% 
----------------------------------------------------------------------

@JialeCao001
Copy link
Owner

Hi. I show results using detectron2, instead of mmdetection. Your problem may be fixed by changing following files:
1814162, 8aac377

@betogulliver
Copy link
Author

thank you! your corrections fixed the problem!

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