Codes of Estimation of Near-Instance-Level Attribute Bottleneck for Zero-Shot Learning (IJCV 2024)
$ cd repository
$ pip install -r requirements.txt
The splits of dataset and its attributes can be found in data[1]. Please download the data folder and place it in ./data/.
Set the --root in opt.py as your code path.
Please download CUB, AWA2, SUN, FLO datasets, and set the --image_root in opt.py to the datasets.
Please download pretrained resnet weights[1] and place it in ./pretrained_models/
You can evaluate our pretrained model.
Please specify the --model_path in opt.py and then run:
python test.py --att_size 85 --image_size 224 --calibrated_stacking 2.0 --seen_classes 40 --nclasses 50
If you wish to try training our model from scratch, please run IAB.py, for example:
python IAB.py --att_size 85 --image_size 224 --t 8 --gamma 2 --delta 2.0 --calibrated_stacking 2.0 --seen_classes 40 --nclasses 50
We are very grateful to the following repos for their great help in constructing our work:
[1] APN. Xu W, Xian Y, Wang J, et al. Attribute prototype network for zero-shot learning[J]. Advances in Neural Information Processing Systems, 2020, 33: 21969-21980.
[2] Softsort. Prillo S, Eisenschlos J. Softsort: A continuous relaxation for the argsort operator[C]//International Conference on Machine Learning. PMLR, 2020: 7793-7802.
[3] C2AM. Xie J, Xiang J, Chen J, et al. C2AM: contrastive learning of class-agnostic activation map for weakly supervised object localization and semantic segmentation[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2022: 989-998.