- Notifications
You must be signed in to change notification settings - Fork40
s3nh/text-detector
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository contains tool which allow to detect region with text and translate it one by one.
Two pretrained neural networks are used. One of them is responsible for detecting places in whichtext 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.
Under construction
I decided to deploy it on heroku (temporarily solution), but the amount of memory available on this platformis not enough.You can check it onheroku app.I decided to add bootstrap template because whole solution become more intuitive.
To install it locally, you can run from your virtual env
python-mpipinstallrequirements.txt
to install it properly on Linux OS you have to install additionaly
apt-get updateapt-get install -y libsm6 libxext6 libxrender-devpip install opencv-python
If problems with cv2 imports are still appearing then you should install
pip install opencv-contrib-python
Then you can run
```pythonpython -m pip install requirements.txt
To run it locally, please activate your environment
> winvenv\Scripts\activate.bat>linuxsource 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.
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 modelon 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 lineIf you like it, give a star
Draft: Show how does it work on complex .tif example document.