faustomorales / vit-keras

Keras implementation of ViT (Vision Transformer)
Apache License 2.0
329 stars 78 forks source link

Update visualize.py: Flexible Image Size #38

Closed rabiaedayilmaz closed 1 year ago

rabiaedayilmaz commented 1 year ago

Added flexible input image size for attention map visualization.

I was using this excellent repo. However, when I wanted to visualize the attention map, I noticed that visualize.py accepts just square input (but mine was rectangle). That is why I adjusted the attention map function: as it will get the dimensions of the height and width of the model input shape, then it will resize a given image to that input shape (not to a square).

faustomorales commented 1 year ago

This is now available in vit-keras v0.1.1.