sandylaker / saliency-metrics

An Open-source Framework for Benchmarking Explanation Methods in Computer Vision
https://saliency-metrics.readthedocs.io
MIT License
1 stars 3 forks source link

Simplify ImageFolder implementation #18

Closed sandylaker closed 2 years ago

sandylaker commented 2 years ago

https://github.com/sandylaker/saliency-metrics/blob/af481ad0fda7fd92f92bfc7107731e96624b9ec1/saliency_metrics/datasets/image_folder.py#L131-L135

The current implementation split the transform to pre and post-pipeline (ToTensorV2), and a saliency map is only transformed by the pre-pipeline. It is to note that ToTensorV2 can also be used for np.ndarray. Therefore, there is no need to split the transform pipeline.

In addition, the collate function can be modified to return the saliency maps either as a tensor or a ndarray.