# TransZero **Repository Path**: indecisive_c/TransZero ## Basic Information - **Project Name**: TransZero - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: test - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-03 - **Last Updated**: 2023-11-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TransZero [[arXiv]](https://arxiv.org/pdf/2112.01683.pdf) This repository contains the testing code for the paper "***TransZero: Attribute-guided Transformer for Zero-Shot Learning***" accepted to AAAI 2022. We have released the training codes of this work in [train branch](https://github.com/shiming-chen/TransZero). ![](figs/pipeline.png) ## Preparing Dataset and Model We provide trained models ([Google Drive](https://drive.google.com/drive/folders/1WK9pm2eX2Rl4rWqXqe_EZiAM8wWB8yqG?usp=sharing)) on three different datasets: [CUB](http://www.vision.caltech.edu/visipedia/CUB-200-2011.html), [SUN](http://cs.brown.edu/~gmpatter/sunattributes.html), [AWA2](http://cvml.ist.ac.at/AwA2/) in the CZSL/GZSL setting. You can download model files as well as corresponding datasets, and organize them as follows: ``` . ├── saved_model │ ├── TransZero_CUB_CZSL.pth │ ├── TransZero_CUB_GZSL.pth │ ├── TransZero_SUN_CZSL.pth │ ├── TransZero_SUN_GZSL.pth │ ├── TransZero_AWA2_CZSL.pth │ └── TransZero_AWA2_GZSL.pth ├── data │ ├── CUB/ │ ├── SUN/ │ └── AWA2/ └── ··· ``` ## Requirements The code implementation of **TransZero** mainly based on [PyTorch](https://pytorch.org/). All of our experiments run and test in Python 3.8.8. To install all required dependencies: ``` $ pip install -r requirements.txt ``` ## Runing Runing following commands and testing **TransZero** on different dataset: CUB Dataset: ``` $ python test.py --config config/CUB_CZSL.json # CZSL Setting $ python test.py --config config/CUB_GZSL.json # GZSL Setting ``` SUN Dataset: ``` $ python test.py --config config/SUN_CZSL.json # CZSL Setting $ python test.py --config config/SUN_GZSL.json # GZSL Setting ``` AWA2 Dataset: ``` $ python test.py --config config/AWA2_CZSL.json # CZSL Setting $ python test.py --config config/AWA2_GZSL.json # GZSL Setting ``` ## Results Results of our released models using various evaluation protocols on three datasets, both in the conventional ZSL (CZSL) and generalized ZSL (GZSL) settings. | Dataset | Acc(CZSL) | U(GZSL) | S(GZSL) | H(GZSL) | | :-----: | :-----: | :-----: | :-----: | :-----: | | CUB | 76.8 | 69.3 | 68.3 | 68.8 | | SUN | 65.6 | 52.6 | 33.4 | 40.8 | | AWA2 | 70.1 | 61.3 | 82.3 | 70.2 | **Note**: All of above results are run on a server with an AMD Ryzen 7 5800X CPU and a NVIDIA RTX A6000 GPU. ## Citation If this work is helpful for you, please cite our paper. ``` @InProceedings{Chen2021TransZero, author = {Chen, Shiming and Hong, Ziming and Liu, Yang and Xie, Guo-Sen and Sun, Baigui and Li, Hao and Peng, Qinmu and Lu, Ke and You, Xinge}, title = {TransZero: Attribute-guided Transformer for Zero-Shot Learning}, booktitle = {Proceedings of the Thirty-Sixth AAAI Conference on Artificial Intelligence (AAAI)}, year = {2022} } ``` ## References Parts of our codes based on: * [hbdat/cvpr20_DAZLE](https://github.com/hbdat/cvpr20_DAZLE) * [zhangxuying1004/RSTNet](https://github.com/zhangxuying1004/RSTNet) ## Contact If you have any questions about codes, please don't hesitate to contact us by gchenshiming@gmail.com or hoongzm@gmail.com.