Downloads · 30 days
0
GnanaPrasath/ocr_tamil
ocr_tamil is a image-to-text model from GnanaPrasath. Use it when you need a caption or text from an image. The card lists the license as mit.
<h1 align="center" OCR Tamil - Easy, Accurate and Simple to use Tamil OCR - (ஒளி எழுத்துணரி)</h1
Downloads · 30 days
0
Access
Public
Updated Feb 14, 2024
Repo size
274 MB
Likes
21
Public
Click a slice to open those files.
.pt191 MB · 70%
From the Hugging Face model README
OCR Tamil can help you extract text from signboard, nameplates, storefronts etc., from Natural Scenes with high accuracy. This version of OCR is much more robust to tilted text compared to the Tesseract, Paddle OCR and Easy OCR as they are primarily built to work on the documents texts and not on natural scenes. This model is work in progress, feel free to contribute!!!
➡️ English
➡️ Tamil (தமிழ்)
✔️ English > 98%
✔️ Tamil > 95%
| Input Image | OCR TAMIL 🏆 | Tesseract | EasyOCR |
|---|---|---|---|
| <img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/4.jpg"> | வாழ்கவளமுடன்✅ | க் க்கஸாரகளள௮ஊகஎளமுடன் ❌ | வாழக வளமுடன்❌ |
| <img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/11.jpg"> | தமிழ்வாழ்க✅ | NO OUTPUT ❌ | தமிழ்வாழ்க✅ |
| <img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/2.jpg"> | கோபி ✅ | NO OUTPUT ❌ | ப99❌ |
| <img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/6.jpg"> | தாம்பரம் ✅ | NO OUTPUT ❌ | தாம்பரம❌ |
| <img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/1.jpg"> | நெடுஞ்சாலைத் ✅ | NO OUTPUT ❌ | நெடுஞ்சாலைத் ✅ |
| <img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/5.jpg"> | அண்ணாசாலை ✅ | NO OUTPUT ❌ | ல@I9❌ |
| <img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/10.jpg"> | ரெடிமேடஸ் ❌ | NO OUTPUT ❌ | ரெடிமேடஸ் ❌ |
Obtained Tesseract and EasyOCR results using the Colab notebook with Tamil and english as language
📔 Detailed explanation on Medium article.
✍️ Experiment in Colab notebook
🤗 Test it in Huggingface spaces
In your command line, run the following command pip install ocr_tamil
If you are using jupyter notebook , install like !pip install ocr_tamil
Text Recognition only
from ocr_tamil.ocr import OCR
image_path = r"test_images\1.jpg" # insert your own path here
ocr = OCR()
text_list = ocr.predict(image_path)
print(text_list[0])
## OUTPUT : நெடுஞ்சாலைத்
<img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/1_180.jpg">
Text Detect + Recognition
from ocr_tamil.ocr import OCR
image_path = r"test_images\0.jpg" # insert your own image path here
ocr = OCR(detect=True)
texts = ocr.predict(image_path)
print(text_list[0])
## OUTPUT : கொடைக்கானல் Kodaikanal
<img width="400" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/0.jpg">
Text Recognition only
from ocr_tamil.ocr import OCR
image_path = [r"test_images\1.jpg",r"test_images\2.jpg"] # insert your own image paths here
ocr = OCR()
text_list = ocr.predict(image_path)
for text in text_list:
print(text)
## OUTPUT : நெடுஞ்சாலைத்
## OUTPUT : கோபி
Text Detect + Recognition
from ocr_tamil.ocr import OCR
image_path = [r"test_images\0.jpg",r"test_images\tamil_sentence.jpg"] # insert your own image paths here
ocr = OCR(detect=True)
text_list = ocr.predict(image_path)
for text in text_list:
print(text)
## OUTPUT : கொடைக்கானல் Kodaikanal
## OUTPUT : செரியர் யற்கை மூலிகைகளில் இருந்து ஈர்த்தெடுக்க்கப்பட்ட வீரிய உட்பொருட்களை உள்ளடக்கி எந்த இரசாயன சேர்க்கைகளும் இல்லாமல் உருவாக்கப்பட்ட இந்தியாவின் முதல் சித்த தயாரிப்பு
Tested using Python 3.10 on Windows & Linux (Ubuntu 22.04) Machines
Currently supports Only English and Tamil Language
Document Text reading capability is limited. Auto identification of Paragraph, line are not supported along with Text detection model inability to detect and crop the Tamil text leads to accuracy decrease (WORKAROUND Can use your own text detection model along with OCR tamil text recognition model)
**?**யற்கை மூலிகைகளில் இருந்து ஈர்த்தெடுக்கக்கப்பட்ட வீரிய உட்பொருட்களை உள்ளடக்கி எந்த இரசாயன சேர்க்கைகளும் இல்லாமல் உருவாக்கப்பட்ட இந்தியாவின் முதல் சித்த தயாரிப்பு
Text detection - CRAFT TEXT DECTECTION
Text recognition - PARSEQ
@InProceedings{bautista2022parseq,
title={Scene Text Recognition with Permuted Autoregressive Sequence Models},
author={Bautista, Darwin and Atienza, Rowel},
booktitle={European Conference on Computer Vision},
pages={178--196},
month={10},
year={2022},
publisher={Springer Nature Switzerland},
address={Cham},
doi={10.1007/978-3-031-19815-1_11},
url={https://doi.org/10.1007/978-3-031-19815-1_11}
}
@inproceedings{baek2019character,
title={Character Region Awareness for Text Detection},
author={Baek, Youngmin and Lee, Bado and Han, Dongyoon and Yun, Sangdoo and Lee, Hwalsuk},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={9365--9374},
year={2019}
}
@InProceedings{GnanaPrasath,
title={Tamil OCR},
author={Gnana Prasath D},
month={01},
year={2024},
url={https://github.com/gnana70/tamil_ocr}
}
