Textboxes : Image Text Detection Model : python package (tensorflow)

Overview

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


svtexample

Dependancies

  1. python Version: 3.5.3
  2. numpy Version: 1.13.0
  3. tensorflow Version: 1.2.1
  4. cv2

How to use

  1. Clone this repository to your local.
  2. You will use shintb python package and config.py for building and training your own Textboxes model.
  3. svt1 gives us training / test data.
  4. Open new python file.
  5. Import config.config and shintb.
from config import config
from shintb import graph_drawer, default_box_control, svt_data_loader, runner
  1. Initialize GraphDrawer,DefaultBoxControl,SVTDataLoader instance.
graphdrawer = graph_drawer.GraphDrawer(config)

dataloader = svt_data_loader.SVTDataLoader('./svt1/train.xml', './svt1/test.xml')

dbcontrol = default_box_control.DefaultBoxControl(config, graphdrawer)
  1. GraphDrawer instance contains a tensorflow graph of Textboxes.

  2. DefaultboxControl instance contains methods and attributes which is related to default box.

  3. SVTDataLoader instance loads data from svt1.

  4. Initialize Runner instance.

runner = runner.Runner(config, graphdrawer, dataloader, dbcontrol)
  1. Runner uses GraphDrawer,DefaultBoxControl,SVTDataLoader instance.
  2. If you want to train your Textboxes model, use Runner.train(). Every 1000 step, shintb will save ckpt file in the directory you set in config.py.
runner.train()
  1. If you want to validate/test your model, use Runner.test()
runner.test()
  1. After training, if you want to detect texts from one image use Runner.image().
runner.image(<your_image_directory>)
Comments
  • Module output_drawer has no attribute 'formal_output'

    Module output_drawer has no attribute 'formal_output'

    Has anyone encountered this error when tryint to "test" or "image"?

    Traceback (most recent call last):
      File "testShinTB.py", line 15, in <module>
        runner.test(5)
      File "/home/great/Documentos/spi/shinTB/shintb/runner.py", line 194, in test
        output_boxes, output_confidence = self.outputdrawer.format_output(pred_conf[0], pred_loc[0])
    AttributeError: module 'shintb.output_drawer' has no attribute 'format_output'
    

    I am just tryint to run an example based on the README.

    opened by romulofff 1
  • Error happens while saving checkpoint. How to fix it? Thanks a lot

    Error happens while saving checkpoint. How to fix it? Thanks a lot

    GLOBAL STEP : 1000 / LEARNING RATE : 0.0008 / LOSS : 1.18235 ( 0.27370095253 secs) Traceback (most recent call last): File "main.py", line 30, in runner.train(FLAGS.jobname, FLAGS.iter) File "/home/wanghz/shinTB/shintb/runner.py", line 101, in train ckpt_path = self.saver.save(self.sess, "%s.ckpt" % (c["saved_dir"]+"/"+jobname),global_step) File "/opt/DL/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1369, in save self.last_checkpoints, latest_filename) File "/opt/DL/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 796, in update_checkpoint_state text_format.MessageToString(ckpt)) File "/opt/DL/tensorflow/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 353, in atomic_write_string_to_file rename(temp_pathname, filename, overwrite=True) File "/opt/DL/tensorflow/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 335, in rename compat.as_bytes(oldname), compat.as_bytes(newname), overwrite, status) File "/usr/lib/python2.7/contextlib.py", line 24, in exit self.gen.next() File "/opt/DL/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.FailedPreconditionError: saved/checkpoint.tmp205d246fabab4cb488968fcc6989f6d7

    opened by white2018 0
  • Model not correct

    Model not correct

    I tried to train and test the model but I think that there are many and many errors within it. The most important is that confidence and delta are predicted as really big numbers (i.e. 1.8e+8). This make the project not usable until a real deep analysis of it

    opened by DavidSeas 1
  • how to runner.image?

    how to runner.image?

    1.when I run main.py --mode = image occur this problem,how to solve this? If you know, please call me. Thank you @shinjayne .

    OpenCV(3.4.1) Error: Assertion failed (depth == 0 || depth == 2 || depth == 5) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 11109 Traceback (most recent call last): File "main.py", line 34, in runner.image() File "/home/dell/gen/shinTB/shintb/runner.py", line 260, in image self.outputdrawer.draw_outputs(test_img, output_boxes , output_confidence , wait=1) File "/home/dell/gen/shinTB/shintb/output_drawer.py", line 100, in draw_outputs I = cv2.cvtColor(I, cv2.COLOR_RGB2BGR) cv2.error: OpenCV(3.4.1) /io/opencv/modules/imgproc/src/color.cpp:11109: error: (-215) depth == 0 || depth == 2 || depth == 5 in function cvtColor

    2.when I run "runner.image" occur this problem,how to solve this? If you know, please call me. Thank you @shinjayne .

    Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774 Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774 Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774 Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774 Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774 Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774 Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774 Textboxes information! rect_start : (0, 0) // rect_end : (0, 0) confidence: 0.499774

    opened by porridgeshoes 2
  • It seemed that

    It seemed that "h" should be like this "h = float(rectangle.get('height')) / imageHeight"???

    https://github.com/shinjayne/shinTB/blob/c6c46817a13b8f26c7d6a6809370a15d44538365/shintb/svt_data_loader.py#L35

    		imageWidth = float(image.find('Resolution').get('x'))
    		imageHeight = float(image.find('Resolution').get('y'))
    		taggedRectangles = image.find('taggedRectangles')
    		for rectangle in taggedRectangles.findall('taggedRectangle'):
    			h = float(rectangle.get('height')) / imageHeight
    			w = float(rectangle.get('width'))  / imageWidth
    			x = float(rectangle.get('x'))      / imageWidth
    			y = float(rectangle.get('y'))      / imageHeight
    
    opened by matrix246 0
Owner
Jayne Shin (신재인)
Humble 🙏 Hungry 👁 Smart 🧠
Jayne Shin (신재인)
Textboxes implementation with Tensorflow (python)

tb_tensorflow A python implementation of TextBoxes Dependencies TensorFlow r1.0 OpenCV2 Code from Chaoyue Wang 03/09/2017 Update: 1.Debugging optimize

Jayne Shin (신재인) 20 May 31, 2019
TextBoxes re-implement using tensorflow

TextBoxes-TensorFlow TextBoxes re-implementation using tensorflow. This project is greatly inspired by slim project And many functions are modified ba

Gu Xiaodong 44 Dec 29, 2022
TextBoxes++: A Single-Shot Oriented Scene Text Detector

TextBoxes++: A Single-Shot Oriented Scene Text Detector Introduction This is an application for scene text detection (TextBoxes++) and recognition (CR

Minghui Liao 930 Jan 4, 2023
Motion detector, Full body detection, Upper body detection, Cat face detection, Smile detection, Face detection (haar cascade), Silverware detection, Face detection (lbp), and Sending email notifications

Security camera running OpenCV for object and motion detection. The camera will send email with image of any objects it detects. It also runs a server that provides web interface with live stream video.

Peace 10 Jun 30, 2021
text detection mainly based on ctpn model in tensorflow, id card detect, connectionist text proposal network

text-detection-ctpn Scene text detection based on ctpn (connectionist text proposal network). It is implemented in tensorflow. The origin paper can be

Shaohui Ruan 3.3k Dec 30, 2022
A Tensorflow model for text recognition (CNN + seq2seq with visual attention) available as a Python package and compatible with Google Cloud ML Engine.

Attention-based OCR Visual attention-based OCR model for image recognition with additional tools for creating TFRecords datasets and exporting the tra

Ed Medvedev 933 Dec 29, 2022
This project modify tensorflow object detection api code to predict oriented bounding boxes. It can be used for scene text detection.

This is an oriented object detector based on tensorflow object detection API. Most of the code is not changed except for those related to the need of

Dafang He 30 Oct 22, 2022
Handwritten Text Recognition (HTR) system implemented with TensorFlow (TF) and trained on the IAM off-line HTR dataset. This Neural Network (NN) model recognizes the text contained in the images of segmented words.

Handwritten-Text-Recognition Handwritten Text Recognition (HTR) system implemented with TensorFlow (TF) and trained on the IAM off-line HTR dataset. T

null 27 Jan 8, 2023
Deskew is a command line tool for deskewing scanned text documents. It uses Hough transform to detect "text lines" in the image. As an output, you get an image rotated so that the lines are horizontal.

Deskew by Marek Mauder https://galfar.vevb.net/deskew https://github.com/galfar/deskew v1.30 2019-06-07 Overview Deskew is a command line tool for des

Marek Mauder 127 Dec 3, 2022
Repository for Scene Text Detection with Supervised Pyramid Context Network with tensorflow.

Scene-Text-Detection-with-SPCNET Unofficial repository for [Scene Text Detection with Supervised Pyramid Context Network][https://arxiv.org/abs/1811.0

null 121 Oct 15, 2021
This is a tensorflow re-implementation of PSENet: Shape Robust Text Detection with Progressive Scale Expansion Network.My blog:

PSENet: Shape Robust Text Detection with Progressive Scale Expansion Network Introduction This is a tensorflow re-implementation of PSENet: Shape Robu

Michael liu 498 Dec 30, 2022
🔎 Like Chardet. 🚀 Package for encoding & language detection. Charset detection.

Charset Detection, for Everyone ?? The Real First Universal Charset Detector A library that helps you read text from an unknown charset encoding. Moti

TAHRI Ahmed R. 332 Dec 31, 2022
A novel region proposal network for more general object detection ( including scene text detection ).

DeRPN: Taking a further step toward more general object detection DeRPN is a novel region proposal network which concentrates on improving the adaptiv

Deep Learning and Vision Computing Lab, SCUT 151 Dec 12, 2022
An Implementation of the alogrithm in paper IncepText: A New Inception-Text Module with Deformable PSROI Pooling for Multi-Oriented Scene Text Detection

InceptText-Tensorflow An Implementation of the alogrithm in paper IncepText: A New Inception-Text Module with Deformable PSROI Pooling for Multi-Orien

GeorgeJoe 115 Dec 12, 2022
Code for the paper STN-OCR: A single Neural Network for Text Detection and Text Recognition

STN-OCR: A single Neural Network for Text Detection and Text Recognition This repository contains the code for the paper: STN-OCR: A single Neural Net

Christian Bartz 496 Jan 5, 2023
deployment of a hybrid model for automatic weapon detection/ anomaly detection for surveillance applications

Automatic Weapon Detection Deployment of a hybrid model for automatic weapon detection/ anomaly detection for surveillance applications. Loved the pro

Janhavi 4 Mar 4, 2022
keras复现场景文本检测网络CPTN: 《Detecting Text in Natural Image with Connectionist Text Proposal Network》;欢迎试用,关注,并反馈问题...

keras-ctpn [TOC] 说明 预测 训练 例子 4.1 ICDAR2015 4.1.1 带侧边细化 4.1.2 不带带侧边细化 4.1.3 做数据增广-水平翻转 4.2 ICDAR2017 4.3 其它数据集 toDoList 总结 说明 本工程是keras实现的CPTN: Detecti

mick.yi 107 Jan 9, 2023
Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)

Detecting Text in Natural Image with Connectionist Text Proposal Network The codes are used for implementing CTPN for scene text detection, described

Tian Zhi 1.3k Dec 22, 2022