Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 3a3e360

Browse files
authoredNov 10, 2021
Merge pull request #437 from GT-ZhangAcer/master
New multi language OCR example.
2 parents a777e4e + 5a0b1b2 commit 3a3e360

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed
 

‎projects/Multi_language_OCR/README.MD

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Script Title
2+
<!--Remove the below lines and add yours -->
3+
Multi language OCR example
4+
5+
### Prerequisites
6+
<!--Remove the below lines and add yours -->
7+
```shell
8+
pip install agentocr==1.3.0
9+
pip install onnxruntime==1.8.1
10+
```
11+
or
12+
```shell
13+
pip install -r ./projects/Multi_language_OCR/requirements.txt
14+
```
15+
### How to run the script
16+
<!--Remove the below lines and add yours -->
17+
Execute `python3 multi_language_OCR.py`
18+
19+
If you need complete operation documents, you can refer to [AgentOCR advanced tutorial](https://github.com/AgentMaker/AgentOCR)
20+
21+
### Screenshot/GIF showing the sample use of the script
22+
<!--Remove the below lines and add yours -->
23+
![Screenshot of the Output](Screenshot.png)
24+
25+
## *Author Name*
26+
<!--Remove the below lines and add yours -->
27+
[GT-ZhangAcer](https://github.com/GT-ZhangAcer)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Author: Acer Zhang
2+
# Datetime: 2021/9/14
3+
# Copyright belongs to the author.
4+
# Please indicate the source for reprinting.
5+
6+
language = """
7+
Language Abbreviation Language Abbreviation
8+
Chinese & English ch Arabic ar
9+
English en Hindi hi
10+
French fr Uyghur ug
11+
German german Persian fa
12+
Japan japan Urdu ur
13+
Korean korean Serbian(latin) rs_latin
14+
Chinese Traditional chinese_cht Occitan oc
15+
Italian it Marathi mr
16+
Spanish es Nepali ne
17+
Portuguese pt Serbian(cyrillic) rs_cyrillic
18+
Russia ru Bulgarian bg
19+
Ukranian uk Estonian et
20+
Belarusian be Irish ga
21+
Telugu te Croatian hr
22+
Saudi Arabia sa Hungarian hu
23+
Tamil ta Indonesian id
24+
Afrikaans af Icelandic is
25+
Azerbaijani az Kurdish ku
26+
Bosnian bs Lithuanian lt
27+
Czech cs Latvian lv
28+
Welsh cy Maori mi
29+
Danish da Malay ms
30+
Maltese mt Adyghe ady
31+
Dutch nl Kabardian kbd
32+
Norwegian no Avar ava
33+
Polish pl Dargwa dar
34+
Romanian ro Ingush inh
35+
Slovak sk Lak lbe
36+
Slovenian sl Lezghian lez
37+
Albanian sq Tabassaran tab
38+
Swedish sv Bihari bh
39+
Swahili sw Maithili mai
40+
Tagalog tl Angika ang
41+
Turkish tr Bhojpuri bho
42+
Uzbek uz Magahi mah
43+
Vietnamese vi Nagpur sck
44+
Mongolian mn Newari new
45+
Abaza abq Goan Konkani gom
46+
"""
47+
48+
# Import AgentOCR python module
49+
from agentocr import OCRSystem
50+
51+
# Choose OCR language
52+
print(language)
53+
config = input("Please enter the language you want to recognize:")
54+
# Init OCRSystem
55+
ocr = OCRSystem(config=config)
56+
print("OCR system Initialization complete!")
57+
58+
# Start OCR!
59+
while True:
60+
img = input("Please enter the path where the picture file is located:")
61+
results = ocr.ocr(img)
62+
for info in results:
63+
print(info)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
agentocr==1.3.0
2+
onnxruntime==1.8.1

0 commit comments

Comments
 (0)
This repository has been archived.