项目作者: channelCS

项目描述 :
Generative paper implementations for Zero-Shot Learning
高级语言: Python
项目地址: git://github.com/channelCS/ZSL_Generative.git
创建时间: 2021-05-20T19:49:11Z
项目社区:https://github.com/channelCS/ZSL_Generative

开源协议:

下载


ZSL_Generative

An open source Zero Shot Classification toolbox based on PyTorch.

Installation

The model is built in PyTorch 1.6.0 and tested on Ubuntu 16.04 environment (Python3.7, CUDA11.0, cuDNN7.5).

For installing, follow these intructions

  1. conda create -n pytorch160 python=3.7
  2. conda activate pytorch160
  3. conda install pytorch=1.6 torchvision cudatoolkit=11.0 -c pytorch
  4. pip install -r requirements.txt

Data preparation

Download CUB, AWA2, FLO and SUN features using downlaod.sh inside datasets folder.

  1. cd datasets; sh download.sh; cd ../

Training and Evaluation

Zero-Shot Image Classification

To train and evaluate ZSL and GZSL models on CUB, AWA2, FLO and SUN, please run:

  1. CUB: python train_images.py -opt options/Tfvaegan/CUB.yml
  2. AWA2: python train_images.py -opt options/Tfvaegan/AWA2.yml
  3. FLO: python train_images.py -opt options/Tfvaegan/FLO.yml
  4. SUN: python train_images.py -opt options/Tfvaegan/SUN.yml

Finetuning Inductive

Download finetuned weights for the CUB, AWA2, FLO and SUN features from the drive link shared below.

  1. link: https://drive.google.com/drive/folders/13-eyljOmGwVRUzfMZIf_19HmCj1yShf1?usp=sharing

Training and Evaluation

To train and evaluate ZSL and GZSL models for the finetune inductive setting on CUB, AWA2, FLO and SUN, please run:

  1. CUB: python train_images.py -opt options/Tfvaegan/CUB_ft.yml
  2. AWA2: python train_images.py -opt options/Tfvaegan/AWA2_ft.yml
  3. FLO: python train_images.py -opt options/Tfvaegan/FLO_ft.yml
  4. SUN: python train_images.py -opt options/Tfvaegan/SUN_ft.yml

Wandb Logger

wandb can be viewed as a cloud version of tensorboard. One can easily view training processes and curves in wandb.
To enable wandb logging edit the configuration file.

  1. wandb: True