lartpang / PySODMetrics

PySODMetrics: A Simple and Efficient Implementation of Grayscale/Binary Segmentation Metrcis
https://pypi.org/project/pysodmetrics/
MIT License
145 stars 19 forks source link

Split image-level processing from cross-image processing #8

Open piercus opened 4 months ago

piercus commented 4 months ago

Hello @lartpang, thanks for this great lib.

I would like to be able, on a big dataset, to store image-level metrics.

Context

For example

Image1 :

Image2 :

Image3 :

And then to be able to run the evaluation on different tags (foo/bar) (without re-running the image-level metrics computation)

Actual

In the current lib it is not direct to do this, because the image-level processing, and the cross-images processing are made together, and there is no cross-metric convention.

Suggestion

In metric.step(pred, gt)

As a result

Would you be interested to change the API for this ? Would you like some help ?

lartpang commented 4 months ago

@piercus

Thanks for the idea, maybe the following extension code is what you want?

This code below is used to evaluate the algorithms for the video tasks.

https://github.com/lartpang/PySODEvalToolkit/blob/f12dcf5925750c9ea73c535ee8d99ed40cf1cb4c/utils/recorders/metric_recorder.py#L201-L279