jacobgil / pytorch-grad-cam

Advanced AI Explainability for computer vision. Support for CNNs, Vision Transformers, Classification, Object detection, Segmentation, Image similarity and more.
https://jacobgil.github.io/pytorch-gradcam-book
MIT License
9.79k stars 1.52k forks source link

Address cv2.resize float16 issue in scale_cam_image #494

Closed Christophe-Foyer closed 1 month ago

Christophe-Foyer commented 3 months ago

https://github.com/jacobgil/pytorch-grad-cam/issues/198 https://github.com/jacobgil/pytorch-grad-cam/issues/493

Putting in a PR to go along with my issue post.

cv2.resize doesn't support float16 which causes this step to break. This fixes the issue with not downstream consequences that I can identify since the resulting image gets converted to lfoat32 anyways.

giorgiop commented 1 month ago

any chance we can merge and release? @Christophe-Foyer

jacobgil commented 1 month ago

Merged. Thank you for the contribution.