Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Text to image synthesis using thought vectors
| Date | Stars |
|---|---|
| 2026-07-24 | 2161 |
| 2026-07-25 | 2161 |
| 2026-07-28 | 2161 |
| 2026-07-30 | 2161 |
| 2026-07-31 | 2162 |
| 2026-08-06 | 2162 |
Today
— stars today
This week
+1 stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.05%/day
# Text To Image Synthesis Using Thought Vectors
[](https://gitter.im/text-to-image/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This is an experimental tensorflow implementation of synthesizing images from captions using [Skip Thought Vectors][1]. The images are synthesized using the GAN-CLS Algorithm from the paper [Generative Adversarial Text-to-Image Synthesis][2]. This implementation is built on top of the excellent [DCGAN in Tensorflow][3]. The following is the model architecture. The blue bars represent the Skip Thought Vectors for the captions.

Image Source : [Generative Adversarial Text-to-Image Synthesis][2] Paper
## Requirements
- Python 2.7.6
- [Tensorflow][4]
- [h5py][5]
- [Theano][6] : for skip thought vectors
- [scikit-learn][7] : for skip thought vectors
- [NLTK][8] : for skip thought vectors
## Datasets
- All the steps below for downloading the datasets and models can be performed automatically by running `python download_datasets.py`. Several gigabytes of files will be downloaded and extracted.
- The model is currently trained on the [flowers dataset][9]. Download the images from [this link][9] and save them in ```Data/flowers/jpg```. Also download the captions from [this link][10]. Extract the archive, copy the ```text_c10``` folder and paste it in ```Data/flowers```.
- Download the pretrained models and vocabulary for skip thought vectors as per the instructions given [here][13]. Save the downloaded files in ```Data/skipthoughts```.
- Make empty directories in Data, ```Data/samples```, ```Data/val_samples``` and ```Data/Models```. They will be used for sampling the generated images and saving the trained models.
## Usage
- <b>Data Processing</b> : Extract the skip thought vectors for the flowers data set using :
```
python data_loader.py --data_set="flowers"
```
- <b>Training</b>
* Basic usage `python train.py --data_set="flowers"`
* Options
- `z_dim`: Noise Dimension. Default is 100.
- `t_dim`: Text feature dimension. Default is 256.
- `batch_size`: Batch Size. Default is 64.
- `image_size`: Image dimension. Default is 64.
- `gf_dim`: Number of conv in the first layer generator. Default is 64.
- `df_dim`: Number of conv in the first layer discriminator. Default is 64.
- `gfc_dim`: Dimension of gen untis for for fully connected layer. Default is 1024.
- `caption_vector_length`: Length of the caption vector. Default is 1024.
- `data_dir`: Data Directory. Default is `Data/`.
- `learning_rate`: Learning Rate. Default is 0.0002.
- `beta1`: Momentum for adam update. Default is 0.5.
- `epochs`: Max number of epochs. Default is 600.
- `resume_model`: Resume training from a pretrained model path.
- `data_set`: Data Set to train on. Default is flowers.
- <b>Generating Images from Captions</b>
* Write the captions in text file, and save it as ```Data/sample_captions.txt```. Generate the skip thought vectors for these captions using:
```
python generate_thought_vectors.py --caption_file="Data/sample_captions.txt"
```
* Generate the Images for the thought vectors using:
```
python generate_images.py --model_path=<path to the trained model> --n_images=8
```
```n_images``` specifies the number of images to be generated per caption. The generated images will be saved in ```Data/val_samples/```. ```python generate_images.py --help``` for more options.
## Sample Images Generated
Following are the images generated by the generative model from the captions.
| Caption | Generated Images |
| ------------- | -----:|
| the flower shown has yellow anther red pistil and bright red petals |  |
| this flower has petals that are yellow, white and purple and has dark linExcerpt of 6,525 characters
Read on GitHub32
7
The Gitter Badger · Gitter
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:f5352a7f7abc907b, topic:deep-learning, topic:tensorflow
matched fp:f5352a7f7abc907b, name:text-to-image, desc:text-to-image, readme:text-to-image