Skip to content

Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Vedaldi, Andrew Zisserman, CVPR 2016.

License

Notifications You must be signed in to change notification settings

youscan/SynthText

 
 

Repository files navigation

SynthText

Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Vedaldi, Andrew Zisserman, CVPR 2016 with some modifications.

Pre-generated Dataset

A dataset with approximately 800000 synthetic scene-text images generated with this code can be found here.

Adding New Images

Segmentation and depth-maps are required to use new images as background. Sample scripts for obtaining these are available here.

  • predict_depth.m MATLAB script to regress a depth mask for a given RGB image; uses the network of Liu etal. However, more recent works (e.g., this) might give better results.
  • run_ucm.m and floodFill.py for getting segmentation masks using gPb-UCM.

For an explanation of the fields in dset.h5 (e.g.: seg,area,label), please check this comment.

Pre-processed Background Images

The 8,000 background images used in the paper, along with their segmentation and depth masks, have been uploaded here: http://zeus.robots.ox.ac.uk/textspot/static/db/<filename>, where, <filename> can be:

  • imnames.cp [180K]: names of filtered files, i.e., those files which do not contain text
  • bg_img.tar.gz [8.9G]: compressed image files (more than 8000, so only use the filtered ones in imnames.cp)
  • depth.h5 [15G]: depth maps
  • seg.h5 [6.9G]: segmentation maps

Note: I do not own the copyright to these images.

Download corpus and font/color models

wget http://www.robots.ox.ac.uk/~ankush/data.tar.gz

tar -xvf data.tar.gz

To generate images follow instructions in generate_synth_data.ipynb

About

Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Vedaldi, Andrew Zisserman, CVPR 2016.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.0%
  • Jupyter Notebook 14.4%
  • MATLAB 3.6%