youngwanLEE / centermask2

[CVPR 2020] CenterMask : Real-time Anchor-Free Instance Segmentation
Other
781 stars 159 forks source link

Inference on random images using pre-trained models with demo.py does not produce meaningful results #90

Open DavideDaz opened 3 years ago

DavideDaz commented 3 years ago

Hi! and thank you for your great work.

After the installation I tried to run a random inference with the demo file:

python3 demo/demo.py --config-file configs/centermask/Base-CenterMask-ResNet.yaml --input demo/tennis.jpeg

But no detection were found:

[04/21 12:14:17 detectron2]: Arguments: Namespace(confidence_threshold=0.4, config_file='configs/centermask/Base-CenterMask-ResNet.yaml', input=['demo/tennis.jpeg'], opts=[], output=None, video_input=None, webcam=False) WARNING [04/21 12:14:17 d2.config.compat]: Config 'configs/centermask/Base-CenterMask-ResNet.yaml' has no VERSION. Assuming it to be compatible with latest v2. [04/21 12:14:20 detectron2]: demo/tennis.jpeg: detected 0 instances in 0.32s

I tried to lower the threshold to 0.01 to see if anything was detected and here is the result:

Screenshot from 2021-04-21 12-08-00

Is it any issue with the config?

mfinean commented 3 years ago

I also encounter the same issue - testing demo.py on single images via centermask does not seem to detect any instances across a range of test images. Any insights on this would be great.

youngwanLEE commented 3 years ago

@DavideDaz @mfinean Did you properly load the trained weight with MODEL.WEIGHTS argument?

Please refer to the official detectron2 demo instruction.

e.g., python3 demo/demo.py --config-file configs/centermask/centermask_V_39_eSE_FPN_ms_3x.yaml --input demo/tennis.jpeg --opts MODEL.WEIGHTS /path/to/the/weight_folder/centermask2-V-39-eSE-FPN-ms-3x.pth