Text2scene

[CVPR 2019] Text2Scene: Generating Compositional Scenes from Textual Descriptions
Alternatives To Text2scene
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Awesome Deep Text Detection Recognition2,208
2 years ago10apache-2.0
A curated list of resources for text detection/recognition (optical character recognition ) with deep learning methods.
Awesome Scene Text Recognition1,561
5 years ago4
A curated list of resources dedicated to scene text localization and recognition
Image Text Localization Recognition928
17 days ago
A general list of resources to image text localization and recognition 场景文本位置感知与识别的论文资源与实现合集 シーンテキストの位置認識と識別のための論文リソースの要約
Awesome Scene Understanding571
a month agomit
😎 A list of awesome scene understanding papers.
Synsin520
2 years ago12otherPython
View synthesis for the public.
Elasticreconstruction407
7 years ago7otherC++
3D reconstruction system to creating detailed scene geometry from range video.
Awesome Gcn377
4 years ago1
resources for graph convolutional networks (图卷积神经网络相关资源)
Awesome Sketch Synthesis357
10 days ago2
:books: A collection of papers about Sketch Synthesis (Generation).
Neural Motifs348
4 years ago26mitPython
Code for Neural Motifs: Scene Graph Parsing with Global Context (CVPR 2018)
Awesome Vision And Language318
2 months ago
A curated list of awesome vision and language resources (still under construction... stay tuned!)
Alternatives To Text2scene
Select To Compare


Alternative Project Comparisons
Readme

Text2Scene: Generating Compositional Scenes from Textual Descriptions

Fuwen Tan, Song Feng, Vicente Ordonez. CVPR 2019

Overview

In this work, we propose Text2Scene, a model that generates various forms of compositional scene representations from natural language descriptions. Unlike recent works, our method does NOT use Generative Adversarial Networks (GANs). Text2Scene instead learns to sequentially generate objects and their attributes (location, size, appearance, etc) at every time step by attending to different parts of the input text and the current status of the generated scene. We show that under minor modifications, the proposed framework can handle the generation of different forms of scene representations, including cartoon-like scenes, object layouts corresponding to real images, and synthetic images. Our method is not only competitive when compared with state-of-the-art GAN-based methods using automatic metrics and superior based on human judgments but also has the advantage of producing interpretable results.

Installation

  • Setup a conda environment and install some prerequisite packages like this
conda create -n syn python=3.6          # Create a virtual environment
source activate syn         		# Activate virtual environment
conda install jupyter scikit-image cython opencv seaborn nltk pycairo   # Install dependencies
git clone https://github.com/cocodataset/cocoapi.git 			# Install pycocotools
cd cocoapi/PythonAPI
python setup.py build_ext install
python -m nltk.downloader all						# Install NLTK data
  • Please also install pytorch 1.0 (or higher), torchVision, and torchtext
  • Install the repo
git clone https://github.com/uvavision/Text2Scene.git
cd Text2Scene/lib
make
cd ..

Data

  • Download the Abstract Scene and COCO datasets if you have not done so
./experiments/scripts/fetch_data.sh

This will populate the Text2Scene/data folder with AbstractScenes_v1.1, coco/images and coco/annotations. Please note that, for layout generation, we use coco2017 splits. But for composite image generation, we use coco2014 splits for fair comparisons with prior methods. The split info could be found in Text2Scene/data/caches.

Demo

  • Download the pretrained models
./experiments/scripts/fetch_models.sh
  • For the abstract scene and layout generation tasks, simply run
./experiments/scripts/sample_abstract.sh	# Abstract Scene demo
./experiments/scripts/sample_layout.sh	# Layout demo

The scripts will take the example sentences in Text2Scene/examples as input. The step-by-step generation results will appear in Text2Scene/logs. Runing the scripts for the first time would be slow as it takes time to generate cache files (in Text2Scene/data/caches) for the datasets and download the GloVe data.

  • To run the composite and inpainting demos, you need to download auxiliary data, including the image segment database and (optionally) the precomputed nearest neighbor tree. Be careful that the auxiliary data is around 30GB!!
./experiments/scripts/fetch_aux.sh
./experiments/scripts/sample_composites.sh	 # Composites demo
./experiments/scripts/sample_inpainted.sh	 # Inpainting demo

Note that the demos will be run in CPU by default. To use GPU, simply add the --cuda flag in the scripts like:

./tools/abstract_demo.py --cuda --pretrained=abstract_final

Training

You can run the following scripts to train the models:

./experiments/scripts/train_abstract.sh 		# Train the abstract scene model
./experiments/scripts/train_layout.sh 		# Train the coco layout model
./experiments/scripts/train_composites.sh 	# Train the composite image model

The composite image model will be trained using multiple GPUs by default. To use a single GPU, please remove the --parallel flag and modify the batch size using the --batch_size flag accordingly.

Evaluation

You can run the following script to eval the Abstract Scene model:

./experiments/scripts/eval_abstract.sh 		# Evaluate the abstract scene model
./experiments/scripts/eval_layout.sh 		# Evaluate the layout model

The scripts would be run in GPU by default.

Citing

If you find our paper/code useful, please consider citing:

@InProceedings{text2scene2019, 
    author = {Tan, Fuwen and Feng, Song and Ordonez, Vicente},
    title = {Text2Scene: Generating Compositional Scenes from Textual Descriptions},
    booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    month = {June},
    year = {2019}}

License

This project is licensed under the MIT license:

Copyright (c) 2019 University of Virginia, Fuwen Tan, Song Feng, Vicente Ordonez.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Popular Scene Projects
Popular Cvpr Projects
Popular Graphics Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Script
Generation
Scene
Coco
Cvpr
Pretrained Models