wayveai / fiery

PyTorch code for the paper "FIERY: Future Instance Segmentation in Bird's-Eye view from Surround Monocular Cameras"
https://wayve.ai/blog/fiery-future-instance-prediction-birds-eye-view
MIT License
560 stars 85 forks source link

Question about panoptic_metrics function #13

Closed jwookyoo closed 3 years ago

jwookyoo commented 3 years ago

Hi,

Would you be able to explain how the panoptic_metrics function works? (Code linked here: https://github.com/wayveai/fiery/blob/master/fiery/metrics.py#L137) Especially, I wonder why 'void' is included for 'combine_mask', and why 'background' should be changed from 0 to 1.

Also, It is hard to understand the code under the comment "# hack for bincounting 2 arrays together". (Code linked here: https://github.com/wayveai/fiery/blob/master/fiery/metrics.py#L168)

Thank you!

anthonyhu commented 3 years ago

Hello,

The void is included in case one of the class is ignored (usually with the class id 255). The void then has id=0, and background=1. This does not apply to us because we classify the whole bev as background or vehicle.

The bincounting trick is a way to quickly compute a confusion matrix in a classification problem. Suppose you have K classes, then by counting the unique elements in "prediction + K*target" you obtain the confusion matrix. It's the same trick that is used in more classical metrics such as Intersection over union.

Let me know if that wasn't clear and I can explain in more detail.

jwookyoo commented 3 years ago

Thanks! I will take a look more based on your comments.