Tool which allow you to detect and translate text.

Overview

travis build

Text detection and recognition

This repository contains tool which allow to detect region with text and translate it one by one.

Description

Two pretrained neural networks are used. One of them is responsible for detecting places in which text appear and return its coordinates. Structure use for this operation is based on CRAFT architecture.

Second network take detected words and recognize words included inside it. Convolutional Recurrential neural networks (CRNN) are used for this operation.

Example

Under construction

Deployment

I decided to deploy it on heroku (temporarily solution), but the amount of memory available on this platform is not enough. You can check it on heroku app. I decided to add bootstrap template because whole solution become more intuitive.

Windows Installation

To install it locally, you can run from your virtual env

python -m pip install requirements.txt

Linux installation

to install it properly on Linux OS you have to install additionaly


apt-get update
apt-get install -y libsm6 libxext6 libxrender-dev
pip install opencv-python

If problems with cv2 imports are still appearing then you should install

pip install opencv-contrib-python

Then you can run

```python
python -m pip install requirements.txt

Run

To run it locally, please activate your environment

> win
venv\Scripts\activate.bat

>linux
source venv\Scripts\activate

and run straight from project origin

python  app.py

If everything goes properly, you'll see on localhost:8000, screen just like one below.

screen

Updates

I decided to remove argparse, because as I mention earlier, it was less intuitive. Solution is not fast, is more like an toy example which shows how to use Pytorch model on deployment environment.

Version which I use here contain torch-cpu which make preprocessing and detecting slightly slower. I test it on cuda and it was much faster.

If you have more information, drop me a line If you like it, give a star

Draft: Show how does it work on complex .tif example document.

Contact Info

Comments
  • failing with Could not find a version that satisfies the requirement cv2

    failing with Could not find a version that satisfies the requirement cv2

    `eliuha@machine:~/dev/lpr/pytorch-text-recognition$ python app.py --input_file test_image.jpeg /home/eliuha/anaconda3/lib/python3.6/site-packages/matplotlib/font_manager.py:279: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. 'Matplotlib is building the font cache using fc-list. ' Traceback (most recent call last): File "app.py", line 19, in import text_reco.models.craft.craft_utils as craft_utils File "/home/eliuha/dev/lpr/pytorch-text-recognition/text_reco/models/craft/craft_utils.py", line 6, in import cv2 ModuleNotFoundError: No module named 'cv2'

    opened by eliuha 4
  • LinkRefiner

    LinkRefiner

    @s3nh clovaai just released the LinkRefiner code clovaai/CRAFT-pytorch@3cd65f5 better you implement it, along with option to train . So that we can detect text-lines

    opened by ghost 0
  • Training on custom data??

    Training on custom data??

    Hi, I'd like to know if this repo can be used to train CRAFT on custom data using weakly supervised learning ? I have images with a lot of text on them. All of the text has been tagged but at a sentence level, i.e., I have the bounding box information and ground truth label information but at a sentence level. Can weakly supervised learning be used in this case ?

    opened by dhruvsharma717 0
  • CRAFT Model memory usage

    CRAFT Model memory usage

    Seems your code mostly inspired from: https://github.com/clovaai/CRAFT-pytorch

    I was using the same repo for text detection model and saw cpu memory usage of CRAFT model. It increases after each image. Were you able to detect the same problem.

    opened by p9anand 0
  • ValueError: tile cannot extend outside image

    ValueError: tile cannot extend outside image

    Hi, Thanks for this amazing work. I was using this repo for recognition task but when i run the app.py ,upload the image and click on get your results it gives ValueError: tile cannot extend outside image.

    opened by mahendra047 1
Owner
Damian Panek
I am trying to do something useful.
Damian Panek
Applicator Kit for Modo allow you to apply Apple ARKit Face Tracking data from your iPhone or iPad to your characters in Modo.

Applicator Kit for Modo Applicator Kit for Modo allow you to apply Apple ARKit Face Tracking data from your iPhone or iPad with a TrueDepth camera to

Andrew Buttigieg 3 Aug 24, 2021
Securetar - A streaming wrapper around python tarfile and allow secure handling files and support encryption

Secure Tar Secure Tarfile library It's a streaming wrapper around python tarfile

Pascal Vizeli 2 Dec 9, 2022
Spam your friends and famly and when you do your famly will disown you and you will have no friends.

SpamBot9000 Spam your friends and family and when you do your family will disown you and you will have no friends. Terms of Use Disclaimer: Please onl

DJ15 0 Jun 9, 2022
naked is a Python tool which allows you to strip a model and only keep what matters for making predictions.

naked is a Python tool which allows you to strip a model and only keep what matters for making predictions. The result is a pure Python function with no third-party dependencies that you can simply copy/paste wherever you wish.

Max Halford 24 Dec 20, 2022
Deep Text Search is an AI-powered multilingual text search and recommendation engine with state-of-the-art transformer-based multilingual text embedding (50+ languages).

Deep Text Search - AI Based Text Search & Recommendation System Deep Text Search is an AI-powered multilingual text search and recommendation engine w

null 19 Sep 29, 2022
TAP: Text-Aware Pre-training for Text-VQA and Text-Caption, CVPR 2021 (Oral)

TAP: Text-Aware Pre-training TAP: Text-Aware Pre-training for Text-VQA and Text-Caption by Zhengyuan Yang, Yijuan Lu, Jianfeng Wang, Xi Yin, Dinei Flo

Microsoft 61 Nov 14, 2022
Pytorch re-implementation of Paper: SwinTextSpotter: Scene Text Spotting via Better Synergy between Text Detection and Text Recognition (CVPR 2022)

SwinTextSpotter This is the pytorch implementation of Paper: SwinTextSpotter: Scene Text Spotting via Better Synergy between Text Detection and Text R

mxin262 183 Jan 3, 2023
Simple improvement of VQVAE that allow to generate x2 sized images compared to baseline

vqvae_dwt_distiller.pytorch Simple improvement of VQVAE that allow to generate x2 sized images compared to baseline. It allows to generate 512x512 ima

Sergei Belousov 25 Jul 19, 2022
null 113 Nov 28, 2022
This YoloV5 based model is fit to detect people and different types of land vehicles, and displaying their density on a fitted map, according to their coordinates and detected labels.

This YoloV5 based model is fit to detect people and different types of land vehicles, and displaying their density on a fitted map, according to their

Liron Bdolah 8 May 22, 2022
1st Place Solution to ECCV-TAO-2020: Detect and Represent Any Object for Tracking

Instead, two models for appearance modeling are included, together with the open-source BAGS model and the full set of code for inference. With this code, you can achieve around mAP@23 with TAO test set (based on our estimation).

null 79 Oct 8, 2022
Code for EMNLP'21 paper "Types of Out-of-Distribution Texts and How to Detect Them"

ood-text-emnlp Code for EMNLP'21 paper "Types of Out-of-Distribution Texts and How to Detect Them" Files fine_tune.py is used to finetune the GPT-2 mo

Udit Arora 19 Oct 28, 2022
It is a system used to detect bone fractures. using techniques deep learning and image processing

MohammedHussiengadalla-Intelligent-Classification-System-for-Bone-Fractures It is a system used to detect bone fractures. using techniques deep learni

Mohammed Hussien 7 Nov 11, 2022
LF-YOLO (Lighter and Faster YOLO) is used to detect defect of X-ray weld image.

This project is based on ultralytics/yolov3. LF-YOLO (Lighter and Faster YOLO) is used to detect defect of X-ray weld image. Download $ git clone http

null 26 Dec 13, 2022
A project that uses optical flow and machine learning to detect aimhacking in video clips.

waldo-anticheat A project that aims to use optical flow and machine learning to visually detect cheating or hacking in video clips from fps games. Che

waldo.vision 542 Dec 3, 2022
A project that uses optical flow and machine learning to detect aimhacking in video clips.

waldo-anticheat A project that aims to use optical flow and machine learning to visually detect cheating or hacking in video clips from fps games. Che

waldo.vision 383 Nov 1, 2021
A python implementation of Yolov5 to detect fire or smoke in the wild in Jetson Xavier nx and Jetson nano

yolov5-fire-smoke-detect-python A python implementation of Yolov5 to detect fire or smoke in the wild in Jetson Xavier nx and Jetson nano You can see

null 20 Dec 15, 2022