Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bl0 committed Nov 25, 2018
1 parent 2c8f57b commit 3e37b2d
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
HashGAN: Deep Learning to Hash with Pair Conditional Wasserstein GAN
=====================================

Code for ["HashGAN: Deep Learning to Hash with Pair Conditional Wasserstein GAN"](http://openaccess.thecvf.com/content_cvpr_2018/papers/Cao_HashGAN_Deep_Learning_CVPR_2018_paper.pdf).
Code for CVPR 2018 Paper ["HashGAN: Deep Learning to Hash with Pair Conditional Wasserstein GAN"](http://openaccess.thecvf.com/content_cvpr_2018/papers/Cao_HashGAN_Deep_Learning_CVPR_2018_paper.pdf).


## Prerequisites

- Python3, NumPy, TensorFlow-gpu, SciPy, Matplotlib, easydict, yacs, tqdm
- Python3, NumPy, TensorFlow-gpu, SciPy, Matplotlib, OpenCV, easydict, yacs, tqdm
- A recent NVIDIA GPU

We provide a `environment.yaml` for you and you can simplely use `conda env create -f environment.yml` to create the environment

```bash
conda create --no-default-packages -n HashGAN python=3.6 && source activate HashGAN
conda install -y numpy scipy matplotlib tensorflow-gpu opencv
pip install easydict yacs tqdm pillow
```

## Data Preparation
In `data_list/` folder, we give three examples to show how to prepare image training data. If you want to add other datasets as the input, you need to prepare `train.txt`, `test.txt`, `database.txt` and `database_nolabel.txt` as CIFAR-10 dataset.

You can download the whole cifar10 dataset including the images and data list from [here](https://github.com/thulab/DeepHash/releases/download/v0.1/cifar10.zip), and unzip it to data/cifar10 folder.
You can download the whole cifar10 dataset including the images and data list from [here](https://github.com/thulab/DeepHash/releases/download/v0.1/cifar10.zip), and unzip it to `data/cifar10` folder.

Make sure the tree of `/path/to/project/data/cifar10` looks like this:
If you need run on NUSWIDE_81 and COCO, we recommend you to follow [here](https://github.com/thuml/HashNet/tree/master/pytorch#datasets) to prepare NUSWIDE_81 and COCO images.

```
.
|-- database.txt
|-- database_nolabel.txt
|-- test
|-- test.txt
|-- train
`-- train.txt
```
## Pretrained Models
You can download the pretrained models in the [release page](https://github.com/thuml/HashGAN/releases) and modify config file to use the pretrained models.

## Training

If you need run on NUSWIDE_81 and COCO, we recommend you to follow https://github.com/thuml/HashNet/tree/master/pytorch#datasets to prepare NUSWIDE_81 and COCO images.
The training process can be divided into two step:
1. Training a image generator.
2. Fintune Alexnet using original labeled images and generated images.

## Models
### TODO
In `config` folder, we provide some examples to prepare yaml configuration.

- [ ] code refactor
- [ ] wgan scale == 0
- [ ] G, D architecture
- [ ] evaluate mode
- [ ] resume training
- [ ] tensorboard
- [ ] experiment
- [ ] training longger
- [ ] code release
- [ ] pretrained G model
- [ ] Pretrain model of Alexnet
- [ ] rerun all process on a fresh machine
```
config
├── cifar_evaluation.yaml
├── cifar_step_1.yaml
├── cifar_step_2.yaml
└── nuswide_step_1.yaml
```

You can run the model using command like the following:

Configuration for th models is specified in a list of constants at the top of
the file, you can use the following command to run it:
- `python main.py --cfg config/cifar_step_1.yaml --gpus 0`
- `python main.py --cfg config/cifar_step_2.yaml --gpus 0`

- `python main.py`
You can use tensorboard to monitor the training process such as losses and Mean Average Precision.

## Citation
If you use this code for your research, please consider citing:
Expand All @@ -63,7 +64,7 @@ If you use this code for your research, please consider citing:

## Contact
If you have any problem about our code, feel free to contact
- caoyue10@gmail.com
- liubinthss@gmail.com

- caoyue10@gmail.com

or describe your problem in Issues.

0 comments on commit 3e37b2d

Please sign in to comment.