You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo is a convenient clone of AttnGAN by MSFT Research. You can find the original repo at [here](https://github.com/taoxugit/AttnGAN.git).
2
+
This repo is a convenient clone of AttnGAN by MSFT Research. You can find the original repo at [here](https://github.com/taoxugit/AttnGAN.git).
3
+
4
+
AttnGAN original repo contains the training and testing code. But this repo is solely intended to use for generating images from text using MSCOCO pretrained weights.
3
5
4
6
# AttnGAN
5
7
@@ -9,11 +11,11 @@ with Attentional Generative Adversarial Networks](http://openaccess.thecvf.com/c
@@ -23,52 +25,27 @@ with Attentional Generative Adversarial Networks](http://openaccess.thecvf.com/c
23
25
-`nltk`
24
26
-`scikit-image`
25
27
26
-
27
-
**Data**
28
-
29
-
1. Download our preprocessed metadata for [birds](https://drive.google.com/open?id=1O_LtUP9sch09QH3s_EBAgLEctBQ5JBSJ) or [coco](https://drive.google.com/open?id=1rSnbIGNDGZeHlsUlLdahj0RJ9oo6lgH9) and save them to `data/`
30
-
2. Download the [birds](http://www.vision.caltech.edu/visipedia/CUB-200-2011.html) image data. Extract them to `data/birds/`
31
-
3. Download [coco](http://cocodataset.org/#download) dataset and extract the images to `data/coco/`
32
-
33
-
34
-
**Training**
35
-
- Pre-train DAMSM models:
36
-
- For bird dataset: `python pretrain_DAMSM.py --cfg cfg/DAMSM/bird.yml --gpu 0`
37
-
- For coco dataset: `python pretrain_DAMSM.py --cfg cfg/DAMSM/coco.yml --gpu 1`
38
-
39
-
- Train AttnGAN models:
40
-
- For bird dataset: `python main.py --cfg cfg/bird_attn2.yml --gpu 2`
41
-
- For coco dataset: `python main.py --cfg cfg/coco_attn2.yml --gpu 3`
42
-
28
+
**YML files**
43
29
-`*.yml` files are example configuration files for training/evaluation our models.
44
30
45
31
46
32
**Pretrained Model**
47
-
-[DAMSM for bird](https://drive.google.com/open?id=1GNUKjVeyWYBJ8hEU-yrfYQpDOkxEyP3V). Download and save it to `DAMSMencoders/`
48
-
-[DAMSM for coco](https://drive.google.com/open?id=1zIrXCE9F6yfbEJIbNP5-YrEe2pZcPSGJ). Download and save it to `DAMSMencoders/`
49
-
-[AttnGAN for bird](https://drive.google.com/open?id=1lqNG75suOuR_8gjoEPYNp8VyT_ufPPig). Download and save it to `models/`
33
+
-[DAMSM for coco](https://drive.google.com/open?id=1zIrXCE9F6yfbEJIbNP5-YrEe2pZcPSGJ). Download and save it to `DAMSMencoders/coco/`
50
34
-[AttnGAN for coco](https://drive.google.com/open?id=1i9Xkg9nU74RAvkcqKE-rJYhjvzKAMnCi). Download and save it to `models/`
51
35
52
-
-[AttnDCGAN for bird](https://drive.google.com/open?id=19TG0JUoXurxsmZLaJ82Yo6O0UJ6aDBpg). Download and save it to `models/`
53
-
- This is an variant of AttnGAN which applies the propsoed attention mechanisms to DCGAN framework.
54
-
55
-
**Sampling**
56
-
- Run `python main.py --cfg cfg/eval_bird.yml --gpu 1` to generate examples from captions in files listed in "./data/birds/example_filenames.txt". Results are saved to `DAMSMencoders/`.
57
-
- Change the `eval_*.yml` files to generate images from other pre-trained models.
58
-
- Input your own sentence in "./data/birds/example_captions.txt" if you wannt to generate images from customized sentences.
59
-
60
-
**Validation**
61
-
- To generate images for all captions in the validation dataset, change B_VALIDATION to True in the eval_*.yml. and then run `python main.py --cfg cfg/eval_bird.yml --gpu 1`
62
-
- We compute inception score for models trained on birds using [StackGAN-inception-model](https://github.com/hanzhanggit/StackGAN-inception-model).
63
-
- We compute inception score for models trained on coco using [improved-gan/inception_score](https://github.com/openai/improved-gan/tree/master/inception_score).
36
+
**Setup script**
64
37
38
+
Run the following script for setting up the dependencies.
65
39
66
-
**Examples generated by AttnGAN [[Blog]](https://blogs.microsoft.com/ai/drawing-ai/)**
0 commit comments