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

Improve type hints #480

Open hoel-bagard opened 4 months ago

hoel-bagard commented 4 months ago

This PR marks some optional arguments as optional, and makes some numpy types more specific.

numpy.typing.NDArray requires numpy >= 1.21, so I'm not sure if it can be used here (since the numpy version is not pinned in the requirements.txt).