Skip to content

Commit

Permalink
v1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rkcosmos committed Feb 1, 2021
1 parent 40e96b8 commit 2042c0f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
[![Tweet](https://img.shields.io/twitter/url/https/github.com/JaidedAI/EasyOCR.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20this%20awesome%20library:%20EasyOCR%20https://github.com/JaidedAI/EasyOCR)
[![Twitter](https://img.shields.io/badge/[email protected]?style=flat)](https://twitter.com/JaidedAI)

Ready-to-use OCR with 70+ languages supported including Chinese, Japanese, Korean and Thai.
Ready-to-use OCR with 80+ languages supported including Chinese, Japanese, Korean and Thai.

## What's new
- 1 February 2021 - Version 1.2.3
- Add `setLanguageList` method to `Reader` class. This is a convenient api for changing languages (within the same model) after creating class instance.
- Small change on text box merging. (thanks [z-pc](https://github.com/z-pc), see [PR](https://github.com/JaidedAI/EasyOCR/pull/338))
- [Basic Demo on website](https://www.jaided.ai/easyocr)
- 5 January 2021 - Version 1.2.2
- Add `optimal_num_chars` to `detect` method. If specified, bounding boxes with estimated number of characters near this value are returned first. (thanks [@adamfrees](https://github.com/adamfrees))
- Add `rotation_info` to `readtext` method. Allow EasyOCR to rotate each text box and return the one with the best confident score. Eligible values are 90, 180 and 270. For example, try [90, 180 ,270] for all possible text orientations. (thanks [@mijoo308](https://github.com/mijoo308))
Expand Down Expand Up @@ -38,7 +42,7 @@ Ready-to-use OCR with 70+ languages supported including Chinese, Japanese, Korea

## Supported Languages

We are currently supporting 70+ languages. See [list of supported languages](https://www.jaided.ai/easyocr).
We are currently supporting 80+ languages. See [list of supported languages](https://www.jaided.ai/easyocr).

## Installation

Expand Down
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.2.2'
__version__ = '1.2.3'
18 changes: 10 additions & 8 deletions easyocr/easyocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,7 @@ def __init__(self, lang_list, gpu=True, model_storage_directory=None,
assert calculate_md5(model_path) == model_url[model_file][1], corrupt_msg
LOGGER.info('Download complete')

self.lang_char = []
for lang in lang_list:
char_file = os.path.join(BASE_PATH, 'character', lang + "_char.txt")
with open(char_file, "r", encoding = "utf-8-sig") as input_file:
char_list = input_file.read().splitlines()
self.lang_char += char_list
self.lang_char = set(self.lang_char).union(set(number+symbol))
self.lang_char = ''.join(self.lang_char)
self.setLanguageList(lang_list)

dict_list = {}
for lang in lang_list:
Expand Down Expand Up @@ -266,6 +259,15 @@ def getChar(self, fileName):
char = ''.join(list)
return char

def setLanguageList(self, lang_list):
self.lang_char = []
for lang in lang_list:
char_file = os.path.join(BASE_PATH, 'character', lang + "_char.txt")
with open(char_file, "r", encoding = "utf-8-sig") as input_file:
char_list = input_file.read().splitlines()
self.lang_char += char_list
self.lang_char = set(self.lang_char).union(set(number+symbol))
self.lang_char = ''.join(self.lang_char)

def detect(self, img, min_size = 20, text_threshold = 0.7, low_text = 0.4,\
link_threshold = 0.4,canvas_size = 2560, mag_ratio = 1.,\
Expand Down
4 changes: 4 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- 1 February 2021 - Version 1.2.3
- Add `setLanguageList` method to `Reader` class. This is a convenient api for changing languages (within the same model) after creating class instance.
- Small change on text box merging. (thanks [z-pc](https://github.com/z-pc), see [PR](https://github.com/JaidedAI/EasyOCR/pull/338))
- [Basic Demo on website](https://www.jaided.ai/easyocr)
- 5 January 2021 - Version 1.2.2
- Add `optimal_num_chars` to `detect` method. If specified, bounding boxes with estimated number of characters near this value are returned first. (thanks [@adamfrees](https://github.com/adamfrees))
- Add `rotation_info` to `readtext` method. Allow EasyOCR to rotate each text box and return the one with the best confident score. Eligible values are 90, 180 and 270. For example, try [90, 180 ,270] for all possible text orientations. (thanks [@mijoo308](https://github.com/mijoo308))
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.2.2',
version='1.2.3',
install_requires=requirements,
entry_points={"console_scripts": ["easyocr= easyocr.cli:main"]},
license='Apache License 2.0',
Expand Down

0 comments on commit 2042c0f

Please sign in to comment.