Skip to content

jjjkkkjjj/pytorch_TextBoxesPP

Repository files navigation

TextBoxes++ with PyTorch

The implementation of TextBoxes++ with PyTorch.

Requirement

pip install --upgrade git+https://github.com/jjjkkkjjj/pytorch_SSD.git
conda install lxml
conda install -c conda-forge shapely

Pre-train

  • First, download SynthText dataset from official.

  • Second, convert gt.mat into annotation xml files using synthtext_generator.py.

    python synthtext_generator.py {path} -id SynthText
    usage: synthtext_generator.py [-h] [-in IMAGE_DIRNAME] [-sm] [-e ENCODING]
                                  path
    
    Generate Synthtext's annotation xml file
    
    positional arguments:
      path                  directory path under 'SynthText'(, 'licence.txt')
    
    optional arguments:
      -h, --help            show this help message and exit
      -id IMAGE_DIRNAME, --image_dirname IMAGE_DIRNAME
                            image directory name including 'gt.mat'
      -sm, --skip_missing   Wheter to skip missing image
      -e ENCODING, --encoding ENCODING
                            encoding
  • Train. See demo/pre-train-SynthText.ipynb.

  • You can download pre-trained model from here.

  • Pre-trained model's output example;

pre-trained img

Train ICDAR2015

  • First, download dataset from official.

  • Second, place annotation .txt and .jpg like this;

    ├── Annotations (place .txt)
    └── Images (place .jpg)
  • Train. See demo/train-ICDAR2015.ipynb.

  • You can download pre-trained model from here.

  • ICDAR's model output example;

icdar-trained img

Convert png to jpg for Born Digital Images

$ python png2jpg ~/data/text/Born-Digital-Images/Images/ -d
Converting...	100.0%	[307/307]
finished

Reference

SynthText

COCO-text

COCO-text api

DDI-100

DDI-100 api

About

textbox++ implementation with PyTorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages