segment-anything icon indicating copy to clipboard operation
segment-anything copied to clipboard

How can I measure segmentation performance?

Open BuKeMod opened this issue 1 year ago • 2 comments

Hi ,How can I measure segmentation performance?

Thanks for your answers.

BuKeMod avatar Jan 03 '24 04:01 BuKeMod

If you mean the quality of the segmentation mask, then the most popular way seems to be to use intersection-over-union (IoU) between the predicted segmentation mask and a ground truth mask (i.e. the result you'd want, ideally). You'd probably want to do this over a range of possible results and maybe take the average IoU (or possibly the max or min, depending on your use case) as a measure of the performance.

On the otherhand, if by performance you mean the inference speed (i.e. how quickly the model runs), then you might be able to get away with using the built-in python timing functions (for example, calling perf_counter before and after model execution). If you're using cuda, you also have to be careful about making sure to 'synchronize' to get meaningful timing (and it may be better to use cuda events to do this).

heyoeyo avatar Jan 05 '24 19:01 heyoeyo

Thanks, I'll try the IoU method.

BuKeMod avatar Jan 08 '24 03:01 BuKeMod