by Chao Tan, Xin Feng
This repository contains the source code and pretrained model for our TC-GAN, provided by Chao Tan.
The paper is avaliable for download here.
Click here for more details.
The USR dataset can be download from MaskShadowGAN.
The ISTD dataset can be download from ST-CGAN.
- Python 3.7
- PyTorch >= 1.2.0
- opencv 0.4
- PyQt 4
- numpy
- visdom
-
Please download and unzip USR dataset and place it in
/datasets/data
folder. Then modify the dataset to the structure ofTRAIN_A,TRAIN_B,TEST_A and TEST_B
. -
Training
- Run
python -m visdom.server"
to activate visdom server. - Run
python run.py
to start training from scratch. - You can easily monitor training process at any time by visiting
http://localhost:8097
in your browser.
- Run
-
Testing
- After the training is over, you can test the performance of the model on the test dataset.
First, you need to modify the
configs/tcgan_usr256.yaml
file and change the status option from train to test. - You need to pretrain a classification network offline for testing.
The structure of the classification network can be obtained in
net.py
script. After obtaining the model, please name the pretrained classifierclassifier.pkl
and place it in the root directory. - Run
python run.py
for testing, and the test result will be saved incheckpoints/tcgan_usr256/testing
.
- After the training is over, you can test the performance of the model on the test dataset.
First, you need to modify the
- You can download the pretrained model (TianYiCloud or BaiduCloud, extraction code: h3zg) of TC-GAN under USR dataset.
And put the
tcgan_usr256
andclassifier.pkl
under thecheckpoints\
folder and root directory respectively. - You need to modify the
configs/tcgan_usr256.yaml
file and change the status option from train to test. - Run
python run.py
for testing, and the test result will be saved incheckpoints/tcgan_usr256/testing
.
Update soon...