|
||
---|---|---|
dataset | ||
datasets | ||
transforms | ||
utils | ||
.DS_Store | ||
.gitattributes | ||
CUB_test.py | ||
LICENSE | ||
README.md | ||
resnet_swap_2loss_add.py | ||
train_rel.py |
README.md
Destruction and Construction Learning for Fine-grained Image Recognition
By Yue Chen, Yalong Bai, Wei Zhang, Tao Mei
Introduction
This code is relative to the DCL, which is accepted on CVPR 2019.
This DCL code in this repo is written based on Pytorch 0.4.0.
This code has been tested on Ubuntu 16.04.3 LTS with Python 3.6.5 and CUDA 9.0.
Yuo can use this public docker image as the test environment:
docker pull pytorch/pytorch:0.4-cuda9-cudnn7-devel
Citing DCL
If you find this repo useful in your research, please consider citing:
@article{chen2019dcl,
title={Destruction and Construction Learning for Fine-grained Image Recognition},
author={Chen Yue and Bai, Yalong and Zhang Wei and Mei Tao},
journal={arXiv preprint arXiv:},
year={2019}
}
Requirements
-
Pytorch 0.4.0
-
Numpy, Pillow, Pandas
-
GPU: P40, etc. (May have bugs on the latest V100 GPU)
Datasets Prepare
-
Download CUB-200-2011 dataset form Caltech-UCSD Birds-200-2011
-
Unzip the dataset file under the folder 'datasets'
-
Run ./datasets/CUB_pre.py to generate annotation files 'train.txt', 'test.txt' and image folder 'all' for CUB-200-2011 dataset
Testing Demo
-
Download
CUB_model.pth
from Google Drive. -
Run
CUB_test.py
Training on CUB-200-2011
-
Run
train.py
to train and test the CUB-200-2011 datasets. Wait about half day for training and testing. -
Hopefully it would give the evaluation results around ~87.8% acc after running.
Support for other datasets will be updated later