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.
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 thatToTensorV2
can also be used fornp.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.