Skip to content
YuHsuanLiPublic

About

This project is the author implementation of Make an Omelette with Breaking Eggs:Zero-Shot Learning for Novel Attribute Synthesis

Resources

Stars

9 stars

Watchers

1 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

Repository files navigation

ZSLA

This project is the author implementation of Make an Omelette with Breaking Eggs:Zero-Shot Learning for Novel Attribute Synthesis

Installation

clone the project

Clone this project by git clone

git clone https://github.com/evaProjectARICL/ZSLA.git

enviroment setting

Go to the ZSLA folder

cd ZSLA

Install anaconda and then create a enviroment, whose name is ZSLA (set in the first line of yaml file)

conda env create -f environment.yml

Activate the environment ZSLA

conda activate ZSLA

data download

Download the image features of CUB or ɑ-CLEVR extracted by Resnet101 (pretrained on ImageNet) and put them in under the path: ZSLA/data/CUB or ZSLA/data/alpha-CLEVR respectively.

run

run ZSLA

Their are two stages in ZSLA, the first stage is to obtain the seen attribute directors and the second stage is to train intersection/union models and use them to syntheize the unseen attribute directors. Here we use CUB dataset as example:

stage 1

If want to run ɑ-CLEVR dataset, add --data_type=alpha-CLEVR and change the cpt_weight from 0.2 to 1 (--cpt_weight=1)
train:

python main.py --device=cuda:5 --stage=1 --is_normalized --is_abs --use_location_info --cpt_weight=0.2 --umc_start=0  --output_PATH=./outputs/stage1_cub

test:

python main.py --test --device=cuda:5 --stage=1  --is_normalized --is_abs --attributes_PATH=./outputs/stage1_cub/classifier_10000.pth

stage 2

train:

python main.py --device=cuda:5 --stage=2 --is_normalized --is_abs --attributes_PATH=./outputs/stage1_cub/classifier_10000.pth --output_PATH=./outputs/stage2_cub

test:

python main.py --test --device=cuda:5 --stage=2 --gate_PATH=./outputs/stage2_cub/model_200000.pth

run baseline

A-ESZSL

train:

python main.py --baseline --method=A-ESZSL --device=cuda:5 --use_location_info --output_PATH=./outputs/A_ESZSL_cub 

test:

python main.py --test --baseline --method=A-ESZSL --device=cuda:5 --use_location_info --baseline_PATH=./outputs/A_ESZSL_cub/model_5000.pth

A-LAGO

train:

python main.py --baseline --method=A-LAGO --device=cuda:5 --use_location_info --output_PATH=./outputs/A_LAGO_cub 

test:

python main.py --test --baseline --method=A-LAGO --device=cuda:5 --use_location_info --baseline_PATH=./outputs/A_LAGO_cub/model_5000.pth

About

This project is the author implementation of Make an Omelette with Breaking Eggs:Zero-Shot Learning for Novel Attribute Synthesis

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages