Skip to content

Commit

Permalink
v1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rkcosmos committed Jun 29, 2021
1 parent 89ec92f commit f41e44f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 12 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ Ready-to-use OCR with 80+ [supported languages](https://www.jaided.ai/easyocr) a
[Try Demo on our website](https://www.jaided.ai/easyocr)

## What's new
- 29 June 2021 - Version 1.4
- [Instruction](https://github.com/JaidedAI/EasyOCR/blob/master/custom_model.md) on training/using custom recognition model
- Example [dataset](https://www.jaided.ai/easyocr/modelhub) for model training
- Batched image inference for GPU (thanks [@SamSamhuns](https://github.com/SamSamhuns), see [PR](https://github.com/JaidedAI/EasyOCR/pull/458))
- Vertical text support (thanks [@interactivetech](https://github.com/interactivetech)). This is for rotated text, not to be confused with vertical Chinese or Japanese text. (see [PR](https://github.com/JaidedAI/EasyOCR/pull/450))
- Output in dictionary format (thanks [@A2va](https://github.com/A2va), see [PR](https://github.com/JaidedAI/EasyOCR/pull/441))
- 30 May 2021 - Version 1.3.2
- Faster greedy decoder (thanks [@samayala22](https://github.com/samayala22))
- Faster greedy decoder (thanks [@samayala22](https://github.com/samayala22))
- Fix bug when text box's aspect ratio is disproportional (thanks [iQuartic](https://iquartic.com/) for bug report)
- 20 April 2021 - Version 1.3.1
- Add support for PIL image (thanks [@prays](https://github.com/prays))
Expand All @@ -28,8 +34,7 @@ Ready-to-use OCR with 80+ [supported languages](https://www.jaided.ai/easyocr) a
- [Read all released notes](https://github.com/JaidedAI/EasyOCR/blob/master/releasenotes.md)

## What's coming next
- Custom models
- [New language support](https://github.com/JaidedAI/EasyOCR/issues/91)
- Handwritten text support

## Examples

Expand Down Expand Up @@ -113,15 +118,14 @@ For more information, read [tutorial](https://www.jaided.ai/easyocr/tutorial) an
$ easyocr -l ch_sim en -f chinese.jpg --detail=1 --gpu=True
```

## Train/use your own model

[read here](https://www.jaided.ai/custom_model.md)

## Implementation Roadmap

1. Language packs: Expand support to more languages. We are aiming to cover > 80-90% of world's population. Also improve existing languages.
2. Better documentation and api
3. Language model for better decoding
4. Handwritten support: The key is using GAN to generate realistic handwritten dataset.
5. Faster processing time: model pruning (lite version) / quantization / export to other platforms (ONNX?)
6. Open Dataset and model training pipeline
7. Restructure code to support swappable detection and recognition algorithm.
- Handwritten support
- Restructure code to support swappable detection and recognition algorithm.
The api should be as easy as
``` python
reader = easyocr.Reader(['en'], detection='DB', recognition = 'Transformer')
Expand Down
30 changes: 30 additions & 0 deletions custom_model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Custom model

## How to train your custom model

There are 2 options to train your own recognition model.

**1. Open-source approach**

For the open-source approach, you can use your own data or generate your own dataset. To generate your own data, we recommend using
[TextRecognitionDataGenerator](https://github.com/Belval/TextRecognitionDataGenerator). We provide an example of dataset [here](https://jaided.ai/easyocr/modelhub/).
After you have a dataset, you can train your own model by following this repository
[deep-text-recognition-benchmark](https://github.com/clovaai/deep-text-recognition-benchmark).
The network needs to be fully convolutional in order to predict flexible text length. Our current network is 'None-VGG-BiLSTM-CTC'.
Once you got your trained model (.pth file), you need 2 additional files describing recognition network architecture and model configuration.
The example is provided in `custom_example.zip` file [here](https://jaided.ai/easyocr/modelhub/).

Please do not create an issue about data generation and model training in this repository. If you have any question regarding data generation and model training, please ask in the respective repositories.

**2. Web-based approach**

Jaided AI provides a web-based (paid) service for training your own model [here](https://jaided.ai/). You can train your model on the cloud and export it for local deployment. All 3 files are downloadable once model is trained on cloud.

## How to use your custom model

To use your own recognition model, you need 3 files either from open-source approach or web-based approach. These three files have to share the same name (for example, yourmodel.pth, yourmodel.yaml, yourmodel.py) and you will call your model by this name in EasyOCR api.

We provide [custom_example.zip](https://jaided.ai/easyocr/modelhub/)
as an example. Please download, extract and place `custom_example.py`, `custom_example.yaml` in user_network_directory (default = `~/.EasyOCR/user_network`) and place `custom_example.pth` in model directory (default = `~/.EasyOCR/model`)
Once you place all 3 files in the right place. You can use `custom_example` by
specifying `recog_network` like this `reader = easyocr.Reader(['en'], recog_network = 'custom_example')`.
2 changes: 1 addition & 1 deletion easyocr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .easyocr import Reader

__version__ = '1.3.2'
__version__ = '1.4'
6 changes: 6 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- 29 June 2021 - Version 1.4
- [Instruction](https://github.com/JaidedAI/EasyOCR/blob/master/custom_model.md) on training/using custom recognition model
- [Example dataset](https://www.jaided.ai/easyocr/modelhub)
- Batched image inference for GPU (thanks [@SamSamhuns](https://github.com/SamSamhuns), see [PR](https://github.com/JaidedAI/EasyOCR/pull/458))
- Vertical text support (thanks [@interactivetech](https://github.com/interactivetech)). This is for rotated text, not to be confused with vertical Chinese or Japanese text. (see [PR](https://github.com/JaidedAI/EasyOCR/pull/450))
- Output in dictionary format (thanks [@A2va](https://github.com/A2va), see [PR](https://github.com/JaidedAI/EasyOCR/pull/441))
- 30 May 2021 - Version 1.3.2
- Faster greedy decoder (thanks [@samayala22](https://github.com/samayala22))
- Fix bug when text box's aspect ratio is disproportional (thanks [iQuartic](https://iquartic.com/) for bug report)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def readme():
name='easyocr',
packages=['easyocr'],
include_package_data=True,
version='1.3.2',
version='1.4',
install_requires=requirements,
entry_points={"console_scripts": ["easyocr= easyocr.cli:main"]},
license='Apache License 2.0',
Expand Down

0 comments on commit f41e44f

Please sign in to comment.