mobulan / IELT

Source code of the paper Fine-Grained Visual Classification via Internal Ensemble Learning Transformer
MIT License
39 stars 4 forks source link

head1,head2,..visual attention hot map #3

Closed RC-Qiao closed 1 year ago

RC-Qiao commented 1 year ago

可以上传一下可视化attention map of each head的代码么

mobulan commented 1 year ago

我已经添加了可视化代码,使用方法:1》通过训练获得checkpoint.bin,2》修改setup.py,注释第5行,激活第6行(除非将可视化文件放在外面,暂时没发现更好的办法)3》打开HeadMapVisualize,修改main函数中图像和检查点的路径,以及第21行的保存路径 4》运行HeadMapVisualize python visualize/HeadMapVisualize.py