anikde commited on
Commit
e3781ec
·
1 Parent(s): 8af082c
README.md CHANGED
@@ -7,197 +7,28 @@ app_file: app.py
7
  pinned: true
8
  CPU: cpu-basic
9
  suggested_storage: small
10
- sdk_version: 6.0.1
11
  ---
12
 
13
  <p align="center">
14
- <img src="./static/pics/bharatOCR.png" alt="BharatOCR Logo" width="25%">
15
  <h3 align="center">
16
- IndicPhotoOCR - Comprehensive Scene Text Recognition Toolkit </br> across 13 Indian Languages
17
  </h3>
18
  </p>
19
  <div align="center">
20
 
21
- ![Open Source](https://img.shields.io/badge/Open%20Source-Bhashini-FF6C00)
22
- [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FBhashini-IITJ%2FBharatOCR&count_bg=%233D48C8&title_bg=%23555555&icon=&icon_color=%0C0983&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
23
- [![GitHub stars](https://img.shields.io/github/stars/Bhashini-IITJ/BharatOCR.svg?style=social&label=Star&color=orange)](https://github.com/Bhashini-IITJ/BharatOCR/stargazers)
24
- ![GitHub forks](https://img.shields.io/github/forks/Bhashini-IITJ/BharatOCR?style=social)
25
- [![Hugging Face](https://img.shields.io/badge/Hugging_Face-Demo-FF6C00?logo=Huggingface&logoColor=white)](https://huggingface.co/spaces/anikde/BharatOCR)
 
26
 
27
 
 
28
  </div>
29
  <hr style="width: 100%; border: 1px solid #000;">
30
 
31
 
32
-
33
-
34
- IndicPhotoOCR is an advanced OCR toolkit designed for detecting, identifying, and recognizing text across 13 Indian languages, including Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Meitei Odia, Punjabi, Tamil, Telugu, Urdu, and English. Built to handle the unique scripts and complex structures of Indian languages, IndicPhotoOCR provides robust detection and recognition capabilities, making it a valuable tool for processing multilingual documents and enhancing document analysis in these diverse scripts.
35
-
36
- ![](static/pics/visualizeIndicPhotoOCR.png)
37
- <hr style="width: 100%; border: 1px solid #000;">
38
-
39
- ## Table of Content
40
- [Updates](https://github.com/Bhashini-IITJ/BharatOCR/blob/main/README.md#updates)</br>
41
- [Installation](https://github.com/Bhashini-IITJ/BharatOCR/blob/main/README.md#installation)<br>
42
- [How to use](https://github.com/Bhashini-IITJ/BharatOCR/blob/main/README.md#how-to-use)</br>
43
- [Acknowledgement](https://github.com/Bhashini-IITJ/BharatOCR/blob/main/README.md#acknowledgement)</br>
44
- [Contact us](https://github.com/Bhashini-IITJ/BharatOCR/blob/main/README.md#contact-us)</br>
45
-
46
- <hr style="width: 100%; border: 1px solid #000;">
47
-
48
-
49
- ## Updates
50
- <b>[November 2024]:</b> Try demo in [huggingface space](https://huggingface.co/spaces/anikde/BharatOCR).\
51
- <b>[November 2024]:</b> Use this package in [Google Colab](https://colab.research.google.com/drive/1BILXjUF2kKKrzUJ_evubgLHl2busPiH2?usp=sharing).\
52
- <b>[November 2024]:</b> Added support for [10 languages](#config) in the recognition module.</br>
53
- <b>[September 2024]:</b> Private repository created.
54
- <hr style="width: 100%; border: 1px solid #000;">
55
-
56
- ## Installation
57
- Currently we need to manually create virtual environemnt.
58
- ```python
59
- conda create -n indicphotoocr python=3.9 -y
60
- conda activate indicphotoocr
61
-
62
-
63
- git clone https://github.com/Bhashini-IITJ/IndicPhotoOCR.git
64
- cd IndicPhotoOCR
65
- ```
66
- <details>
67
- <summary><b>CPU Installation</b></summary>
68
-
69
- ```bash
70
- python setup.py sdist bdist_wheel
71
- pip install dist/IndicPhotoOCR-1.1.0-py3-none-any.whl[cpu]
72
- ```
73
- </details>
74
-
75
- <details>
76
- <summary><b>CUDA 11.8 Installation</b></summary>
77
-
78
- ```bash
79
- python setup.py sdist bdist_wheel
80
- pip install ./dist/IndicPhotoOCR-1.1.0-py3-none-any.whl[cu118] --extra-index-url https://download.pytorch.org/whl/cu118
81
- ```
82
- </details>
83
-
84
- <details>
85
- <summary><b>CUDA 12.1 Installation</b></summary>
86
-
87
- ```bash
88
- python setup.py sdist bdist_wheel
89
- pip install ./dist/IndicPhotoOCR-1.1.0-py3-none-any.whl[cu121] --extra-index-url https://download.pytorch.org/whl/cu121
90
- ```
91
- </details>
92
- <br>
93
-
94
- If you find any trouble with the above installation use the ```setup.sh``` script.
95
- ```bash
96
- chmod +x setup.sh
97
- ./setup.sh
98
- ```
99
-
100
- ## Config
101
- Currently this model works for hindi v/s english script identification and thereby hindi and english recognition.
102
-
103
- Detection Model: EAST\
104
- ScripIndetification Model: Hindi v/s English\
105
- Recognition Model: Hindi, English, Assamese, Bengali, Gujarati, Marathi, Odia, Punjabi, Tamil, Telugu.
106
-
107
- ## How to use
108
- ### Detection
109
-
110
- ```python
111
- >>> from IndicPhotoOCR.ocr import OCR
112
- # Create an object of OCR
113
- >>> ocr_system = OCR(verbose=True) # for CPU --> OCR(device="cpu")
114
-
115
- # Get detections
116
- >>> detections = ocr_system.detect("test_images/image_141.jpg")
117
-
118
- # Running text detection...
119
- # 4334 text boxes before nms
120
- # 1.027989387512207
121
-
122
- # Save and visualize the detection results
123
- >>> ocr_system.visualize_detection("test_images/image_141.jpg", detections)
124
- # Image saved at: test.png
125
- ```
126
-
127
- ## Cropped Word Recognition
128
- ```python
129
- >>> from IndicPhotoOCR.ocr import OCR
130
- # Create an object of OCR
131
- >>> ocr_system = OCR(verbose=True) # for CPU --> OCR(device="cpu")
132
- # Get recognitions
133
- >>> ocr_system.recognise("test_images/cropped_image/image_141_0.jpg", "hindi")
134
- # Recognizing text in detected area...
135
- # 'मण्डी'
136
- ```
137
-
138
- ## End-to-end Scene Text Recognition
139
- ```python
140
- >>> from IndicPhotoOCR.ocr import OCR
141
- # Create an object of OCR
142
- >>> ocr_system = OCR(verbose=True) # for CPU --> OCR(device="cpu")
143
- # Complete pipeline
144
- >>> ocr_system.ocr("test_images/image_141.jpg")
145
- # Running text detection...
146
- # 4334 text boxes before nms
147
- # 0.9715704917907715
148
- # Identifying script for the cropped area...
149
- # Recognizing text in detected area...
150
- # Recognized word: रोड
151
- # Identifying script for the cropped area...
152
- # Recognizing text in detected area...
153
- # Recognized word: बाराखम्ब
154
- # Identifying script for the cropped area...
155
- # Recognizing text in detected area...
156
- # Using cache found in /DATA1/ocrteam/.cache/torch/hub/baudm_parseq_main
157
- # Recognized word: barakhaml
158
- # Identifying script for the cropped area...
159
- # Recognizing text in detected area...
160
- # Recognized word: हाऊस
161
- # Identifying script for the cropped area...
162
- # Recognizing text in detected area...
163
- # Using cache found in /DATA1/ocrteam/.cache/torch/hub/baudm_parseq_main
164
- # Recognized word: mandi
165
- # Identifying script for the cropped area...
166
- # Recognizing text in detected area...
167
- # Using cache found in /DATA1/ocrteam/.cache/torch/hub/baudm_parseq_main
168
- # Recognized word: chowk
169
- # Identifying script for the cropped area...
170
- # Recognizing text in detected area...
171
- # Recognized word: मण्डी
172
- # Identifying script for the cropped area...
173
- # Recognizing text in detected area...
174
- # Using cache found in /DATA1/ocrteam/.cache/torch/hub/baudm_parseq_main
175
- # Recognized word: road
176
- # Identifying script for the cropped area...
177
- # Recognizing text in detected area...
178
- # Using cache found in /DATA1/ocrteam/.cache/torch/hub/baudm_parseq_main
179
- # Recognized word: house
180
- # Identifying script for the cropped area...
181
- # Recognizing text in detected area...
182
- # Using cache found in /DATA1/ocrteam/.cache/torch/hub/baudm_parseq_main
183
- # Recognized word: rajiv
184
- # Identifying script for the cropped area...
185
- # Recognizing text in detected area...
186
- # Recognized word: राजीव
187
- # Identifying script for the cropped area...
188
- # Recognizing text in detected area...
189
- # Recognized word: चौक
190
-
191
-
192
- ```
193
-
194
- <!-- ## Training -->
195
-
196
- ## Acknowledgement
197
-
198
- Text Recognition - [PARseq](https://github.com/baudm/parseq)\
199
- EAST re-implemenation [repository](https://github.com/foamliu/EAST).<br/>
200
- National Language Translation Mission [Bhashini](https://bhashini.gov.in/).
201
- ## Contact us
202
- For any queries, please contact us at:
203
- - [Anik De](mailto:anekde@gmail.com)
 
7
  pinned: true
8
  CPU: cpu-basic
9
  suggested_storage: small
10
+ sdk_version: 4.44.1
11
  ---
12
 
13
  <p align="center">
14
+ <img src="./static/pics/IndicPhotoOCR_LOGO.png" alt="IndicPhotoOCR Logo" width="45%">
15
  <h3 align="center">
16
+ A Comprehensive Toolkit for Scene Text Recognition in Indian Languages
17
  </h3>
18
  </p>
19
  <div align="center">
20
 
21
+ [![Open Source](https://img.shields.io/badge/Open%20Source-Bhashini-FF6C00)](https://bhashini.gov.in/)
22
+ ![Visitor Count](https://visitor-badge.laobi.icu/badge?page_id=Bhashini-IITJ.IndicPhotoOCR)
23
+ ![GitHub Repo stars](https://img.shields.io/github/stars/Bhashini-IITJ/IndicPhotoOCR?style=social)
24
+ ![GitHub forks](https://img.shields.io/github/forks/Bhashini-IITJ/IndicPhotoOCR?style=social)
25
+ [![Hugging Face](https://img.shields.io/badge/Hugging_Face-Demo-FF6C00?logo=Huggingface&logoColor=white)](https://huggingface.co/spaces/Bhashini-IITJ/IndicPhotoOCR)
26
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1BILXjUF2kKKrzUJ_evubgLHl2busPiH2?usp=sharing#scrollTo=3v76fsYYzVvz)
27
 
28
 
29
+ [![Documentation](https://img.shields.io/badge/Documentation-Click%20Here-007BFF?style=for-the-badge&logo=ReadTheDocs&logoColor=white)](https://bhashini-iitj.github.io/IndicPhotoOCR/)
30
  </div>
31
  <hr style="width: 100%; border: 1px solid #000;">
32
 
33
 
34
+ IndicPhotoOCR is a scene text recognition toolkit designed for detecting, identifying, and recognizing text across Indian languages, including Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu, and English, with support for Urdu and Meitei in the pipeline. It is built to handle the unique scripts and complex structures of Indian languages, offering robust detection and recognition capabilities. The package can be installed with just few lines of code, and a straightforward wrapper function makes it easy to use.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
static/pics/IndicPhotoOCR_LOGO.png ADDED
static/pics/README.md DELETED
@@ -1 +0,0 @@
1
-