This is a tensorflow re-implementation of R2CNN: Rotational Region CNN for Orientation Robust Scene Text Detection.
It should be noted that we did not re-implementate exactly as the paper and just adopted its idea.
This project is based on Faster-RCNN
1、tensorflow >= 1.2
2、cuda8.0
3、python2.7 (anaconda2 recommend)
4、opencv(cv2)
1、please download resnet50_v1、resnet101_v1 pre-trained models on Imagenet, put it to data/pretrained_weights.
2、please download mobilenet_v2 pre-trained model on Imagenet, put it to data/pretrained_weights/mobilenet.
cd $PATH_ROOT/libs/box_utils/
python setup.py build_ext --inplace
cd $PATH_ROOT/libs/box_utils/cython_utils
python setup.py build_ext --inplace
-
This data is prepare using the Label Image tool Label_Image
-
Format
├── Data_source
│ ├── Train
│ ├── Images
│ ├── json
│ ├── Test
│ ├── Images
│ ├── json
python inference_origin.py --data_dir < data path for test>
--type_test < name output folder>
--gpu '0'
1、If you want to train your own data, please note:
(1) Modify parameters (such as CLASS_NUM, DATASET_NAME, VERSION, etc.) in $PATH_ROOT/libs/configs/cfgs.py
(2) Add category information in $PATH_ROOT/libs/label_name_dict/lable_dict.py
(3) Add data_name to line 75 of $PATH_ROOT/data/io/read_tfrecord.py
2、make tfrecord
cd $PATH_ROOT/data/io/
python convert_data_to_tfrecord.py --data_dir <path_to_data_dir>
--json_dir json
--image_dir images
--save_name train
--img_format .jpg
--dataset <name_dataset>
3、train
cd $PATH_ROOT/tools
python train.py
cd $PATH_ROOT/output/summary
tensorboard --logdir=.