Code for our paper: Atzmon & Chechik, "Adaptive Confidence Smoothing for Generalized Zero-Shot Learning", CVPR 2019
- Download or clone the code in this repository.
- cd to the project directory
- Download the data (~500MB) by typing
wget http://chechiklab.biu.ac.il/~yuvval/COSMO/data.zip
- Extract the data by typing
unzip -o data.zip
data.zip
can be deleted
Quick installation under Anaconda:
conda env create -f conda_requirements.yml
Alternatively, below are detailed installation instructions with Anaconda.
yes | conda create -n COSMO python=3.6
conda activate COSMO
yes | conda install pandas ipython jupyter nb_conda matplotlib
yes | conda install scikit-learn=0.19.1
yes | pip install h5py seaborn
# Other packages that I find useful, but are unrelated to this project
yes | conda install -c conda-forge jupyter_contrib_nbextensions
yes | conda install -c conda-forge jupyter_nbextensions_configurator
directory | file | description |
---|---|---|
src/ |
* | Sources files |
src/utils/ |
* | Sources to useful utility procedures. |
data/ |
{CUB, AWA1, SUN, FLO}/ | Xian (CVPR, 2017) zero-shot data for CUB, AWA1, SUN, and FLOWER. |
data/LAGO_GZSL_predictions/*/ |
pred_gzsl_val.npz | predictions of LAGO on GZSL-val set, when trained on train set. |
data/LAGO_GZSL_predictions/*/ |
pred_gzsl_test.npz | predictions of LAGO on GZSL-test set, when trained on train+GZSLval set. |
data/XianGAN_predictions/*/ |
pred_gzsl_val.npz | predictions of fCLSWGAN on GZSL-val set, when trained on train set. |
data/XianGAN_predictions/*/ |
pred_gzsl_test.npz | predictions of fCLSWGAN on GZSL-test set, when trained on train+GZSLval set. |
output/ |
* | Contains the outputs of the experimental framework (results & models). |
output/seen_expert_model/ |
* | Contains cached models for seen experts. |
output/COSMO/ |
* | Contains results of the experimental framework. |
To execute COSMO+LAGO, submit the following in the main project dir.
PYTHONPATH="./" python src/main_cosmo.py --dataset_name=CUB --data_dir=data/CUB --zs_expert_name=LAGO
PYTHONPATH="./" python src/main_cosmo.py --dataset_name=AWA1 --data_dir=data/AWA1 --zs_expert_name=LAGO
PYTHONPATH="./" python src/main_cosmo.py --dataset_name=SUN --data_dir=data/SUN --zs_expert_name=LAGO
To execute COSMO+fCLSWGAN, submit the following in the main project dir.
PYTHONPATH="./" python src/main_cosmo.py --dataset_name=CUB --data_dir=data/CUB --zs_expert_name=XianGAN
PYTHONPATH="./" python src/main_cosmo.py --dataset_name=AWA1 --data_dir=data/AWA1 --zs_expert_name=XianGAN
PYTHONPATH="./" python src/main_cosmo.py --dataset_name=SUN --data_dir=data/SUN --zs_expert_name=XianGAN
PYTHONPATH="./" python src/main_cosmo.py --dataset_name=FLO --data_dir=data/FLO --zs_expert_name=XianGAN
NOTE:
You must run the code from the project root directory.
If you use this code, please cite our paper.
@inproceedings{atzmon2019COSMO,
title={Adaptive Confidence Smoothing for Generalized Zero-Shot Learning},
author={Atzmon, Yuval and Chechik, Gal},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year={2019},
}