junjiehe96 / FastInst

[CVPR2023] FastInst: A Simple Query-Based Model for Real-Time Instance Segmentation
MIT License
178 stars 16 forks source link

About the number of instances #2

Closed Whoo-jl closed 1 year ago

Whoo-jl commented 1 year ago

There are only six categories, but the inference result shows that a total of 100 instances are detected, what is the reason?

junjiehe96 commented 1 year ago

We output test_topk_per_image=100 instances by default for coco evaluation. In actual use, you can try to set a classification threshold, e.g. 0.5, to further filter the output.

Whoo-jl commented 1 year ago

image Does the classification threshold refer to the value of 0.5 in the picture? I set it to 0.9 and it still outputs 100 instances

Whoo-jl commented 1 year ago

Do I need to set 'NUM_OBJECT_QUERIES' and 'DETECTIONS_PER_IMAGE' to my number of categories 6 as well?

junjiehe96 commented 1 year ago

image Does the classification threshold refer to the value of 0.5 in the picture? I set it to 0.9 and it still outputs 100 instances

No, this is the threshold for mask predictions. The classification threshold is set for result.scores.

junjiehe96 commented 1 year ago

Do I need to set 'NUM_OBJECT_QUERIES' and 'DETECTIONS_PER_IMAGE' to my number of categories 6 as well?

If there are only a few instances in an image, you can try reducing "NUM_OBJECT_QUERIES" for better speed-performance trade-off. But this may require you to retrain the model.

'DETECTIONS_PER_IMAGE' generally does not need to be changed. It is used for evaluations.

Whoo-jl commented 1 year ago

image Does the classification threshold refer to the value of 0.5 in the picture? I set it to 0.9 and it still outputs 100 instances

No, this is the threshold for mask predictions. The classification threshold is set for result.scores.

Do I need to set 'NUM_OBJECT_QUERIES' and 'DETECTIONS_PER_IMAGE' to my number of categories 6 as well?

If there are only a few instances in an image, you can try reducing "NUM_OBJECT_QUERIES" for better speed-performance trade-off. But this may require you to retrain the model.

'DETECTIONS_PER_IMAGE' generally does not need to be changed. It is used for evaluations.

Thank you for your patience, under your guidance my problem has been successfully solved!😄

cLEARLoVE00 commented 1 year ago

can you tell me how to slover this problem, I have meet this question? @ @Whoo-jl