shinTB
Abstract
A python package for use Textboxes : Image Text Detection Model
implemented by tensorflow, cv2
Textboxes Paper Review in Korean (My Blog) : shinjayne.github.io/textboxes
shintb : useable textboxes python package (Source codes are in here)
svt1 : Street view Text dataset. can use with shintb.svt_data_loader.SVTDataLoader when training Textboxes model
config.py : (NECESSARY) configuration of model building and training with shinTB
main.py : simple example useage of shinTB package
Dependancies
- python Version: 3.5.3
- numpy Version: 1.13.0
- tensorflow Version: 1.2.1
- cv2
How to use
- Clone this repository to your local.
- You will use
shintbpython package andconfig.pyfor building and training your own Textboxes model. svt1gives us training / test data.- Open new python file.
- Import
config.configandshintb.
from config import config
from shintb import graph_drawer, default_box_control, svt_data_loader, runner
- Initialize
GraphDrawer,DefaultBoxControl,SVTDataLoaderinstance.
graphdrawer = graph_drawer.GraphDrawer(config)
dataloader = svt_data_loader.SVTDataLoader('./svt1/train.xml', './svt1/test.xml')
dbcontrol = default_box_control.DefaultBoxControl(config, graphdrawer)
-
GraphDrawerinstance contains a tensorflow graph of Textboxes. -
DefaultboxControlinstance contains methods and attributes which is related to default box. -
SVTDataLoaderinstance loads data fromsvt1. -
Initialize
Runnerinstance.
runner = runner.Runner(config, graphdrawer, dataloader, dbcontrol)
RunnerusesGraphDrawer,DefaultBoxControl,SVTDataLoaderinstance.- If you want to train your Textboxes model, use
Runner.train(). Every 1000 step,shintbwill save ckpt file in the directory you set inconfig.py.
runner.train()
- If you want to validate/test your model, use
Runner.test()
runner.test()
- After training, if you want to detect texts from one image use
Runner.image().
runner.image(<your_image_directory>)
