Giter Club home page Giter Club logo

text-detection-with-frcn's Introduction

Text Detection Using py-faster-rcnn.

image

Introduction

This repository is aimed at provide an example of training text-detection models using faster-rcnn

Download repo

  • Clone the repository
# Make sure to clone with --recursive
git clone --recursive https://github.com/jugg1024/Text-Detection-with-FRCN.git

Compile

  • Compile py-faster-rcnn

2.1 change the branch of py-faster-rcnn to text-detection-demo

	cd $Text-Detection-with-FRCN/py-faster-rcnn
    	git checkout text-detection

2.2 Build Caffe and pycaffe.

# ensure your enviroment support the training of caffeensure your enviroment support the training of caffe
cd $Text-Detection-with-FRCN/py-faster-rcnn/caffe-fast-rcnn
cp Makefile.config.example Makefile.config
# adjust the Makefile.config
make -j16 && make pycaffe    # here only python api is used.
# test if caffe python api is ok.
cd python
python
>>> import caffe
>>> caffe.__version__
'1.0.0-rc3'

2.3 Build the Cython modules.

cd $Text-Detection-with-FRCN/py-faster-rcnn/lib
make

Run demo

  • Run text detection demo

3.1 download pre-trained model

URL: http://pan.baidu.com/s/1dE2Ori5  Extract Code: phxk
ln -s $DOWNLOAD_MODEL_PATH $Text-Detection-with-FRCN/model/vgg16_faster_rcnn_fine_tune_on_coco.caffemodel

3.2 run demo

cd $Text-Detection-with-FRCN/
./script/text_detect_demo.sh
Results are on output_img

Further

if you think the model is not ok, then you can trainning with your own dataset, take coco-text for example.

  • training

4.1 download coco-text dataset

cd $Text-Detection-with-FRCN/datasets/script
./fetch_dataset.sh coco-text
# download it takes long!
# ensure you have both data and label
# for coco-text label is in COCO-text.json, and data is in train2014.zip

4.2 download pre-train model

# finetune on this model, you can also use one model you train before
cd $Text-Detection-with-FRCN/py-faster-rcnn
./data/scripts/fetch_imagenet_models.sh
# download it takes long!

4.3 format the data(you should write your code here)

# format the raw image and label into the type of pascal_voc
# follow the code in $Text-Detection-with-FRCN/datasets/script/format_annotation.py
cd $Text-Detection-with-FRCN/datasets/script
./format_annotation.py --dataset coco-text

4.4 create a softlink the formatted data to working directorry

# link your data folder to train_data
cd $Text-Detection-with-FRCN/datasets/
ln -s train_data coco-text    # $YOUR_DATA

4.5 training

cd $Text-Detection-with-FRCN/py-faster-rcnn/
./experiments/scripts/faster_rcnn_end2end.sh 0 VGG16 pascal_voc

text-detection-with-frcn's People

Contributors

jugg1024 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.