JialeCao001 / D2Det

D2Det: Towards High Quality Object Detection and Instance Segmentation (CVPR2020)
https://openaccess.thecvf.com/content_CVPR_2020/papers/Cao_D2Det_Towards_High_Quality_Object_Detection_and_Instance_Segmentation_CVPR_2020_paper.pdf
MIT License
297 stars 86 forks source link

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

Closed betogulliver closed 4 years ago

betogulliver commented 4 years ago

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

Hi. I show results using detectron2, instead of mmdetection. Your problem may be fixed by changing following files: https://github.com/JialeCao001/D2Det/commit/1814162f7520dcb5583b8b6817684117e7feda6d, https://github.com/JialeCao001/D2Det/commit/8aac37784a36f68ecb21cf5730d54e4320fda46b

betogulliver commented 4 years ago

thank you! your corrections fixed the problem!