Skip to content

daydreamer2023/FLD_with_CCA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Criss-Cross Attention Pyramid Network for Fashion Landmark Detection

architecture

Requirements

  • Python 3.6
  • gcc 4.8.5
  • CUDA 9.0
  • Pytorch >= 1.0.1
  • torchvision

Quick Start

1. Download the datasets

2. Unzip './Anno/info.zip' file.

3. Train

# 'root' and 'dataset' options are necessary.
usage: train.py [-h] --root ROOT -d DATASET [DATASET ...]
                [--base_epoch BASE_EPOCH] [-b BATCHSIZE] [--epoch EPOCH]
                [--decay-epoch DECAY_EPOCH] [-g GAMMA] [-lr LEARNING_RATE]
                [--evaluate EVALUATE] [-w WEIGHT_FILE] [--loss-type LOSS_TYPE]
                [--cca CCA] [--update-weight UPDATE_WEIGHT]

optional arguments:
  -h, --help            show this help message and exit
  --root ROOT           root path to data directory (default: None)
  -d DATASET [DATASET ...], --dataset DATASET [DATASET ...]
                        deepfashion or fld (default: None)
  --base_epoch BASE_EPOCH
                        base epoch of models to save (default: 0)
  -b BATCHSIZE, --batchsize BATCHSIZE
                        batchsize (default: 50)
  --epoch EPOCH         the number of epoch (default: 30)
  --decay-epoch DECAY_EPOCH
                        decay epoch (default: 5)
  -g GAMMA, --gamma GAMMA
                        decay gamma (default: 0.1)
  -lr LEARNING_RATE, --learning-rate LEARNING_RATE
                        initial learning rate (default: 0.0001)
  --evaluate EVALUATE   evaluation only (default: 0)
  -w WEIGHT_FILE, --weight-file WEIGHT_FILE
                        weight file (default: None)
  --loss-type LOSS_TYPE
                        loss function type (mse or cross_entropy) (default:
                        mse)
  --cca CCA             criss-cross attention module (default: 1)
  --update-weight UPDATE_WEIGHT
  
example: 
python train.py --root ../FLD/ --dataset fld --base_epoch 0 --epoch 9 --learning-rate 1e-3 --decay-epoch 3 -g 0.4 --loss-type mse -b 32 --cca 0
python train.py --root ../FLD/ --dataset fld -w ./models/model_009.pkl --base_epoch 109 --epoch 9 --learning-rate 1e-4 --decay-epoch 3 -g 0.4 --loss-type mse -b 32 --cca 1 --update-weight 1

4. Predict

# You can only change the weight files and target directory in python file currently.
# To ignore any of the weight files, just set the value to None. Target directory is required.
python predict_both.py --root ROOT -d DATASET --batchsize 1

About

Criss-Cross Attention Pyramid Network for Fashion Landmark Detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published