ocr-tamil


Nameocr-tamil JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/gnana70/tamil_ocr
SummaryPython Tamil OCR package
upload_time2025-09-06 21:55:45
maintainerNone
docs_urlNone
authorGnana Prasath
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Gnana Prasath Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ocr ocr tamil tamil indian ocr tamil ocr
VCS
bugtrack_url
requirements aiohappyeyeballs aiohttp aiosignal attrs beautifulsoup4 certifi charset-normalizer colorama contourpy cycler filelock fonttools frozenlist fsspec gdown huggingface-hub idna imageio jinja2 kiwisolver lazy-loader lightning-utilities markupsafe matplotlib mpmath multidict networkx numpy open-tamil opencv-python packaging pandas pillow propcache pyparsing pysocks python-dateutil pytorch-lightning pytz pyyaml requests safetensors scikit-image scipy six soupsieve sympy tifffile timm torch torchmetrics torchvision tqdm typing-extensions tzdata urllib3 yarl
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center"> OCR Tamil - Easy, Accurate and Simple to use Tamil OCR - (ஒளி எழுத்துணரி)</h1>

<p align="center">❤️️❤️️Please star✨ it if you like❤️️❤️️</p>

<p align="center">
  <a href="LICENSE">
    <img src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/MIT.svg" alt="LICENSE">
  </a>
  <a href="https://huggingface.co/spaces/GnanaPrasath/ocr_tamil">
    <img src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/huggingface.svg" alt="HuggingSpace">
  </a>
   <a href="https://colab.research.google.com/drive/11QPPj3EmpoIqnpuIznKeP1icxvVOjfux?usp=sharing">
    <img src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/colab.svg" alt="colab">
  </a>
</p>


<div align="center">
  <p>
    <a href="https://github.com/gnana70/tamil_ocr">
    <img width="50%" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/logo_1.gif">
    </a>
  </p>
</div>

 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.

## Languages Supported 🔛
**➡️ English**

**➡️ Tamil (தமிழ்)**

## Accuracy 🎯
✔️ English > 98%

✔️ Tamil > 95%

## Comparison between Tesseract OCR, EasyOCR and OCR Tamil ⚖️

🏎️ *10-40% faster inference time than EasyOCR and Tesseract*

 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](https://colab.research.google.com/drive/1ylZm6afur85Pe6I10N2_tzuBFl2VIxkW?usp=sharing) with Tamil and english as language**

## Handwritten Text (Experimental)🧪
<img width="500" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/develop/test_images/tamil_handwritten.jpg">


```
MODEL OUTPUT: நிமிர்ந்த நன்னடை மேற்கொண்ட பார்வையும் 
நிலத்தில் யார்க் கும் அஞ்சாத நெறிகளும் 
திமிர்ந்த ஞானச் செருக்கும் இருப்பதால் 
செம்மை மாதர் திறம்புவ தில்லையாம் 
அமிழ்ந்து பேரிரு ளாமறி யாமையில் 
அவல மெய்திக் கலையின்  வாழ்வதை 
உமிழ்ந்து தள்ளுதல் பெண்ணற மாகுமாம் 
உதய கன்ன உரைப்பது கேட்டிரோ 
பாரதியார் 
ஹேமந்த் ம 
```


## How to Install and Use OCR Tamil 👨🏼‍💻

### Quick links🌐
📔 Detailed explanation on [Medium article](https://gnana70.medium.com/ocr-tamil-easy-accurate-and-simple-to-use-tamil-ocr-b03b98697f7b). 

✍️ Experiment in [Colab notebook](https://colab.research.google.com/drive/11QPPj3EmpoIqnpuIznKeP1icxvVOjfux?usp=sharing)

🤗 Test it in [Huggingface spaces](https://huggingface.co/spaces/GnanaPrasath/ocr_tamil)


### Pip install instructions🐍
In your command line, run the following command ```pip install ocr_tamil```

If you are using jupyter notebook , install like ```!pip install ocr_tamil```

### Python Usage - Single image inference

**Text Recognition only**

```python
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**

```python
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(" ".join(texts))

## OUTPUT : கொடைக்கானல் Kodaikanal 

```
<img width="400" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/0.jpg">


### Batch inference mode 💻

**Text Recognition only**

```python
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**

```python
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 item in text_list:
  print(" ".join(item))
    

## OUTPUT : கொடைக்கானல் Kodaikanal 
## OUTPUT : செரியர் யற்கை மூலிகைகளில் இருந்து ஈர்த்தெடுக்க்கப்பட்ட வீரிய உட்பொருட்களை உள்ளடக்கி எந்த இரசாயன சேர்க்கைகளும் இல்லாமல் உருவாக்கப்பட்ட இந்தியாவின் முதல் சித்த தயாரிப்பு 

```

### Advanced usage🚀

OCR module can be initialized by setting following parameters as per your requirements

```
1. Confidence of word ->  OCR(details=1)
2. Bounding Box and Confidence of word -> OCR(detect=True,details=2)
3. To change the CRAFT Text detection settings -> OCR(detect=True,text_threshold=0.5,
                                               link_threshold=0.1,
                                               low_text=0.30)
4. To increase the Batch size of text recognition -> OCR(batch_size=16) # set as per available memory
5. To configure the language to be extracted -> OCR(lang=["tamil"]) # list can take "english" or "tamil" or both. Defaults to both language
```

**Tested using Python 3.10 on Windows & Linux (Ubuntu 22.04) Machines**

## Applications⚡
1. ADAS system navigation based on the signboards + maps (hybrid approach) 🚁
2. License plate recognition 🚘

## Limitations⛔

1. Document text reading capability is not supported as library doesn't have

      **➡️Auto identification of Paragraph**

      **➡️Orientation detection**

      **➡️Skew correction**

      **➡️Reading order prediction**

      **➡️Document unwarping**

      **➡️Optimal Text detection for Document text not available**  

      (**WORKAROUND** Bring your own models for above cases and use with OCR tamil for text recognition)


2. Unable to read the text if they are present in rotated forms

<p align="left">
<img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/9.jpg"> 
<img width="200" alt="teaser" src="https://github.com/gnana70/tamil_ocr/raw/main/test_images/8.jpg">
</p>

3. Currently supports Only Tamil Language. I don't own english model as it's taken from open source implementation of parseq


## Acknowledgements 👏

**Text detection** - [CRAFT TEXT DECTECTION](https://github.com/clovaai/CRAFT-pytorch)

**Text recognition** - [PARSEQ](https://github.com/baudm/parseq)


```bibtex
@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}
}
```

```bibtex
@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}
}
```

## Citation

```bibtex
@InProceedings{GnanaPrasath,
  title={Tamil OCR},
  author={Gnana Prasath D},
  month={01},
  year={2024},
  url={https://github.com/gnana70/tamil_ocr}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gnana70/tamil_ocr",
    "name": "ocr-tamil",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ocr, ocr tamil, tamil, indian ocr, tamil ocr",
    "author": "Gnana Prasath",
    "author_email": "Gnana Prasath <gnana70@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0a/2b/61628274b8ff4e1b3372c061932fd0b5a983a07da57ffbdd9f4086980ae1/ocr_tamil-0.4.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\"> OCR Tamil - Easy, Accurate and Simple to use Tamil OCR - (\u0b92\u0bb3\u0bbf \u0b8e\u0bb4\u0bc1\u0ba4\u0bcd\u0ba4\u0bc1\u0ba3\u0bb0\u0bbf)</h1>\r\n\r\n<p align=\"center\">\u2764\ufe0f\ufe0f\u2764\ufe0f\ufe0fPlease star\u2728 it if you like\u2764\ufe0f\ufe0f\u2764\ufe0f\ufe0f</p>\r\n\r\n<p align=\"center\">\r\n  <a href=\"LICENSE\">\r\n    <img src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/MIT.svg\" alt=\"LICENSE\">\r\n  </a>\r\n  <a href=\"https://huggingface.co/spaces/GnanaPrasath/ocr_tamil\">\r\n    <img src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/huggingface.svg\" alt=\"HuggingSpace\">\r\n  </a>\r\n   <a href=\"https://colab.research.google.com/drive/11QPPj3EmpoIqnpuIznKeP1icxvVOjfux?usp=sharing\">\r\n    <img src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/colab.svg\" alt=\"colab\">\r\n  </a>\r\n</p>\r\n\r\n\r\n<div align=\"center\">\r\n  <p>\r\n    <a href=\"https://github.com/gnana70/tamil_ocr\">\r\n    <img width=\"50%\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/logo_1.gif\">\r\n    </a>\r\n  </p>\r\n</div>\r\n\r\n 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.\r\n\r\n## Languages Supported \ud83d\udd1b\r\n**\u27a1\ufe0f English**\r\n\r\n**\u27a1\ufe0f Tamil (\u0ba4\u0bae\u0bbf\u0bb4\u0bcd)**\r\n\r\n## Accuracy \ud83c\udfaf\r\n\u2714\ufe0f English > 98%\r\n\r\n\u2714\ufe0f Tamil > 95%\r\n\r\n## Comparison between Tesseract OCR, EasyOCR and OCR Tamil \u2696\ufe0f\r\n\r\n\ud83c\udfce\ufe0f *10-40% faster inference time than EasyOCR and Tesseract*\r\n\r\n Input Image                                                                |  OCR TAMIL   \ud83c\udfc6         | Tesseract         | EasyOCR |\r\n|:--------------------------------------------------------------------------:|:--------------------:|:-----------------:|:-----------------:|\r\n| <img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/4.jpg\">                   | \u0bb5\u0bbe\u0bb4\u0bcd\u0b95\u0bb5\u0bb3\u0bae\u0bc1\u0b9f\u0ba9\u0bcd\u2705     |    \u0b95\u0bcd\u200c \u0b95\u0bcd\u0b95\u0bb8\u0bbe\u0bb0\u0b95\u0bb3\u0bb3\u0bee\u0b8a\u0b95\u0b8e\u0bb3\u0bae\u0bc1\u0b9f\u0ba9\u0bcd\u200c \u274c  | \u0bb5\u0bbe\u0bb4\u0b95 \u0bb5\u0bb3\u0bae\u0bc1\u0b9f\u0ba9\u0bcd\u274c|\r\n| <img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/11.jpg\">                   | \u0ba4\u0bae\u0bbf\u0bb4\u0bcd\u0bb5\u0bbe\u0bb4\u0bcd\u0b95\u2705      | **NO OUTPUT** \u274c           | \u0ba4\u0bae\u0bbf\u0bb4\u0bcd\u0bb5\u0bbe\u0bb4\u0bcd\u0b95\u2705      |\r\n| <img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/2.jpg\">                   | \u0b95\u0bcb\u0baa\u0bbf \u2705              | **NO OUTPUT** \u274c          | \u0baa99\u274c          |\r\n| <img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/6.jpg\">                   | \u0ba4\u0bbe\u0bae\u0bcd\u0baa\u0bb0\u0bae\u0bcd \u2705           | **NO OUTPUT** \u274c | \u0ba4\u0bbe\u0bae\u0bcd\u0baa\u0bb0\u0bae\u274c |\r\n| <img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/1.jpg\">                   | \u0ba8\u0bc6\u0b9f\u0bc1\u0b9e\u0bcd\u0b9a\u0bbe\u0bb2\u0bc8\u0ba4\u0bcd \u2705      | **NO OUTPUT** \u274c             |\u0ba8\u0bc6\u0b9f\u0bc1\u0b9e\u0bcd\u0b9a\u0bbe\u0bb2\u0bc8\u0ba4\u0bcd \u2705      |\r\n| <img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/5.jpg\">                   | \u0b85\u0ba3\u0bcd\u0ba3\u0bbe\u0b9a\u0bbe\u0bb2\u0bc8 \u2705     | **NO OUTPUT** \u274c            |  \u0bb2@I9\u274c            |\r\n| <img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/10.jpg\">                  | \u0bb0\u0bc6\u0b9f\u0bbf\u0bae\u0bc7\u0b9f\u0bcd\u0bb8\u0bcd \u2705         |**NO OUTPUT** \u274c     | \u0bb0\u0bc6\u0b9f\u0bbf\u0bae\u0bc7\u0b9f\u0bb8\u0bcd \u274c         |\r\n\r\n**Obtained Tesseract and EasyOCR results using the [Colab notebook](https://colab.research.google.com/drive/1ylZm6afur85Pe6I10N2_tzuBFl2VIxkW?usp=sharing) with Tamil and english as language**\r\n\r\n## Handwritten Text (Experimental)\ud83e\uddea\r\n<img width=\"500\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/develop/test_images/tamil_handwritten.jpg\">\r\n\r\n\r\n```\r\nMODEL OUTPUT: \u0ba8\u0bbf\u0bae\u0bbf\u0bb0\u0bcd\u0ba8\u0bcd\u0ba4 \u0ba8\u0ba9\u0bcd\u0ba9\u0b9f\u0bc8 \u0bae\u0bc7\u0bb1\u0bcd\u0b95\u0bca\u0ba3\u0bcd\u0b9f \u0baa\u0bbe\u0bb0\u0bcd\u0bb5\u0bc8\u0baf\u0bc1\u0bae\u0bcd \r\n\u0ba8\u0bbf\u0bb2\u0ba4\u0bcd\u0ba4\u0bbf\u0bb2\u0bcd \u0baf\u0bbe\u0bb0\u0bcd\u0b95\u0bcd \u0b95\u0bc1\u0bae\u0bcd \u0b85\u0b9e\u0bcd\u0b9a\u0bbe\u0ba4 \u0ba8\u0bc6\u0bb1\u0bbf\u0b95\u0bb3\u0bc1\u0bae\u0bcd \r\n\u0ba4\u0bbf\u0bae\u0bbf\u0bb0\u0bcd\u0ba8\u0bcd\u0ba4 \u0b9e\u0bbe\u0ba9\u0b9a\u0bcd \u0b9a\u0bc6\u0bb0\u0bc1\u0b95\u0bcd\u0b95\u0bc1\u0bae\u0bcd \u0b87\u0bb0\u0bc1\u0baa\u0bcd\u0baa\u0ba4\u0bbe\u0bb2\u0bcd \r\n\u0b9a\u0bc6\u0bae\u0bcd\u0bae\u0bc8 \u0bae\u0bbe\u0ba4\u0bb0\u0bcd \u0ba4\u0bbf\u0bb1\u0bae\u0bcd\u0baa\u0bc1\u0bb5 \u0ba4\u0bbf\u0bb2\u0bcd\u0bb2\u0bc8\u0baf\u0bbe\u0bae\u0bcd \r\n\u0b85\u0bae\u0bbf\u0bb4\u0bcd\u0ba8\u0bcd\u0ba4\u0bc1 \u0baa\u0bc7\u0bb0\u0bbf\u0bb0\u0bc1 \u0bb3\u0bbe\u0bae\u0bb1\u0bbf \u0baf\u0bbe\u0bae\u0bc8\u0baf\u0bbf\u0bb2\u0bcd \r\n\u0b85\u0bb5\u0bb2 \u0bae\u0bc6\u0baf\u0bcd\u0ba4\u0bbf\u0b95\u0bcd \u0b95\u0bb2\u0bc8\u0baf\u0bbf\u0ba9\u0bcd  \u0bb5\u0bbe\u0bb4\u0bcd\u0bb5\u0ba4\u0bc8 \r\n\u0b89\u0bae\u0bbf\u0bb4\u0bcd\u0ba8\u0bcd\u0ba4\u0bc1 \u0ba4\u0bb3\u0bcd\u0bb3\u0bc1\u0ba4\u0bb2\u0bcd \u0baa\u0bc6\u0ba3\u0bcd\u0ba3\u0bb1 \u0bae\u0bbe\u0b95\u0bc1\u0bae\u0bbe\u0bae\u0bcd \r\n\u0b89\u0ba4\u0baf \u0b95\u0ba9\u0bcd\u0ba9 \u0b89\u0bb0\u0bc8\u0baa\u0bcd\u0baa\u0ba4\u0bc1 \u0b95\u0bc7\u0b9f\u0bcd\u0b9f\u0bbf\u0bb0\u0bcb \r\n\u0baa\u0bbe\u0bb0\u0ba4\u0bbf\u0baf\u0bbe\u0bb0\u0bcd \r\n\u0bb9\u0bc7\u0bae\u0ba8\u0bcd\u0ba4\u0bcd \u0bae \r\n```\r\n\r\n\r\n## How to Install and Use OCR Tamil \ud83d\udc68\ud83c\udffc\u200d\ud83d\udcbb\r\n\r\n### Quick links\ud83c\udf10\r\n\ud83d\udcd4 Detailed explanation on [Medium article](https://gnana70.medium.com/ocr-tamil-easy-accurate-and-simple-to-use-tamil-ocr-b03b98697f7b). \r\n\r\n\u270d\ufe0f Experiment in [Colab notebook](https://colab.research.google.com/drive/11QPPj3EmpoIqnpuIznKeP1icxvVOjfux?usp=sharing)\r\n\r\n\ud83e\udd17 Test it in [Huggingface spaces](https://huggingface.co/spaces/GnanaPrasath/ocr_tamil)\r\n\r\n\r\n### Pip install instructions\ud83d\udc0d\r\nIn your command line, run the following command ```pip install ocr_tamil```\r\n\r\nIf you are using jupyter notebook , install like ```!pip install ocr_tamil```\r\n\r\n### Python Usage - Single image inference\r\n\r\n**Text Recognition only**\r\n\r\n```python\r\nfrom ocr_tamil.ocr import OCR\r\n\r\nimage_path = r\"test_images\\1.jpg\" # insert your own path here\r\nocr = OCR()\r\ntext_list = ocr.predict(image_path)\r\nprint(text_list[0])\r\n\r\n## OUTPUT : \u0ba8\u0bc6\u0b9f\u0bc1\u0b9e\u0bcd\u0b9a\u0bbe\u0bb2\u0bc8\u0ba4\u0bcd\r\n```\r\n<img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/1_180.jpg\">\r\n\r\n\r\n**Text Detect + Recognition**\r\n\r\n```python\r\nfrom ocr_tamil.ocr import OCR\r\n\r\nimage_path = r\"test_images\\0.jpg\" # insert your own image path here\r\nocr = OCR(detect=True)\r\ntexts = ocr.predict(image_path)\r\nprint(\" \".join(texts))\r\n\r\n## OUTPUT : \u0b95\u0bca\u0b9f\u0bc8\u0b95\u0bcd\u0b95\u0bbe\u0ba9\u0bb2\u0bcd Kodaikanal \r\n\r\n```\r\n<img width=\"400\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/0.jpg\">\r\n\r\n\r\n### Batch inference mode \ud83d\udcbb\r\n\r\n**Text Recognition only**\r\n\r\n```python\r\nfrom ocr_tamil.ocr import OCR\r\n\r\nimage_path = [r\"test_images\\1.jpg\",r\"test_images\\2.jpg\"] # insert your own image paths here\r\nocr = OCR()\r\ntext_list = ocr.predict(image_path)\r\n\r\nfor text in text_list:\r\n    print(text)\r\n\r\n## OUTPUT : \u0ba8\u0bc6\u0b9f\u0bc1\u0b9e\u0bcd\u0b9a\u0bbe\u0bb2\u0bc8\u0ba4\u0bcd\r\n## OUTPUT : \u0b95\u0bcb\u0baa\u0bbf\r\n\r\n```\r\n\r\n**Text Detect + Recognition**\r\n\r\n```python\r\nfrom ocr_tamil.ocr import OCR\r\n\r\nimage_path = [r\"test_images\\0.jpg\",r\"test_images\\tamil_sentence.jpg\"] # insert your own image paths here\r\nocr = OCR(detect=True)\r\ntext_list = ocr.predict(image_path)\r\n\r\nfor item in text_list:\r\n  print(\" \".join(item))\r\n    \r\n\r\n## OUTPUT : \u0b95\u0bca\u0b9f\u0bc8\u0b95\u0bcd\u0b95\u0bbe\u0ba9\u0bb2\u0bcd Kodaikanal \r\n## OUTPUT : \u0b9a\u0bc6\u0bb0\u0bbf\u0baf\u0bb0\u0bcd \u0baf\u0bb1\u0bcd\u0b95\u0bc8 \u0bae\u0bc2\u0bb2\u0bbf\u0b95\u0bc8\u0b95\u0bb3\u0bbf\u0bb2\u0bcd \u0b87\u0bb0\u0bc1\u0ba8\u0bcd\u0ba4\u0bc1 \u0b88\u0bb0\u0bcd\u0ba4\u0bcd\u0ba4\u0bc6\u0b9f\u0bc1\u0b95\u0bcd\u0b95\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0b9f\u0bcd\u0b9f \u0bb5\u0bc0\u0bb0\u0bbf\u0baf \u0b89\u0b9f\u0bcd\u0baa\u0bca\u0bb0\u0bc1\u0b9f\u0bcd\u0b95\u0bb3\u0bc8 \u0b89\u0bb3\u0bcd\u0bb3\u0b9f\u0b95\u0bcd\u0b95\u0bbf \u0b8e\u0ba8\u0bcd\u0ba4 \u0b87\u0bb0\u0b9a\u0bbe\u0baf\u0ba9 \u0b9a\u0bc7\u0bb0\u0bcd\u0b95\u0bcd\u0b95\u0bc8\u0b95\u0bb3\u0bc1\u0bae\u0bcd \u0b87\u0bb2\u0bcd\u0bb2\u0bbe\u0bae\u0bb2\u0bcd \u0b89\u0bb0\u0bc1\u0bb5\u0bbe\u0b95\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0b9f\u0bcd\u0b9f \u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe\u0bb5\u0bbf\u0ba9\u0bcd \u0bae\u0bc1\u0ba4\u0bb2\u0bcd \u0b9a\u0bbf\u0ba4\u0bcd\u0ba4 \u0ba4\u0baf\u0bbe\u0bb0\u0bbf\u0baa\u0bcd\u0baa\u0bc1 \r\n\r\n```\r\n\r\n### Advanced usage\ud83d\ude80\r\n\r\nOCR module can be initialized by setting following parameters as per your requirements\r\n\r\n```\r\n1. Confidence of word ->  OCR(details=1)\r\n2. Bounding Box and Confidence of word -> OCR(detect=True,details=2)\r\n3. To change the CRAFT Text detection settings -> OCR(detect=True,text_threshold=0.5,\r\n                                               link_threshold=0.1,\r\n                                               low_text=0.30)\r\n4. To increase the Batch size of text recognition -> OCR(batch_size=16) # set as per available memory\r\n5. To configure the language to be extracted -> OCR(lang=[\"tamil\"]) # list can take \"english\" or \"tamil\" or both. Defaults to both language\r\n```\r\n\r\n**Tested using Python 3.10 on Windows & Linux (Ubuntu 22.04) Machines**\r\n\r\n## Applications\u26a1\r\n1. ADAS system navigation based on the signboards + maps (hybrid approach) \ud83d\ude81\r\n2. License plate recognition \ud83d\ude98\r\n\r\n## Limitations\u26d4\r\n\r\n1. Document text reading capability is not supported as library doesn't have\r\n\r\n      **\u27a1\ufe0fAuto identification of Paragraph**\r\n\r\n      **\u27a1\ufe0fOrientation detection**\r\n\r\n      **\u27a1\ufe0fSkew correction**\r\n\r\n      **\u27a1\ufe0fReading order prediction**\r\n\r\n      **\u27a1\ufe0fDocument unwarping**\r\n\r\n      **\u27a1\ufe0fOptimal Text detection for Document text not available**  \r\n\r\n      (**WORKAROUND** Bring your own models for above cases and use with OCR tamil for text recognition)\r\n\r\n\r\n2. Unable to read the text if they are present in rotated forms\r\n\r\n<p align=\"left\">\r\n<img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/9.jpg\"> \r\n<img width=\"200\" alt=\"teaser\" src=\"https://github.com/gnana70/tamil_ocr/raw/main/test_images/8.jpg\">\r\n</p>\r\n\r\n3. Currently supports Only Tamil Language. I don't own english model as it's taken from open source implementation of parseq\r\n\r\n\r\n## Acknowledgements \ud83d\udc4f\r\n\r\n**Text detection** - [CRAFT TEXT DECTECTION](https://github.com/clovaai/CRAFT-pytorch)\r\n\r\n**Text recognition** - [PARSEQ](https://github.com/baudm/parseq)\r\n\r\n\r\n```bibtex\r\n@InProceedings{bautista2022parseq,\r\n  title={Scene Text Recognition with Permuted Autoregressive Sequence Models},\r\n  author={Bautista, Darwin and Atienza, Rowel},\r\n  booktitle={European Conference on Computer Vision},\r\n  pages={178--196},\r\n  month={10},\r\n  year={2022},\r\n  publisher={Springer Nature Switzerland},\r\n  address={Cham},\r\n  doi={10.1007/978-3-031-19815-1_11},\r\n  url={https://doi.org/10.1007/978-3-031-19815-1_11}\r\n}\r\n```\r\n\r\n```bibtex\r\n@inproceedings{baek2019character,\r\n  title={Character Region Awareness for Text Detection},\r\n  author={Baek, Youngmin and Lee, Bado and Han, Dongyoon and Yun, Sangdoo and Lee, Hwalsuk},\r\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\r\n  pages={9365--9374},\r\n  year={2019}\r\n}\r\n```\r\n\r\n## Citation\r\n\r\n```bibtex\r\n@InProceedings{GnanaPrasath,\r\n  title={Tamil OCR},\r\n  author={Gnana Prasath D},\r\n  month={01},\r\n  year={2024},\r\n  url={https://github.com/gnana70/tamil_ocr}\r\n}\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2024 Gnana Prasath\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \"Software\"), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in all\r\n        copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n        SOFTWARE.\r\n        ",
    "summary": "Python Tamil OCR package",
    "version": "0.4.1",
    "project_urls": {
        "Homepage": "https://github.com/gnana70/tamil_ocr"
    },
    "split_keywords": [
        "ocr",
        " ocr tamil",
        " tamil",
        " indian ocr",
        " tamil ocr"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "adc970f6d7375b8a219c67df9262ba0cc9566f878ec113f919f5e614e5707fe1",
                "md5": "422da6bab342c4b535e79f372587c5dd",
                "sha256": "103ded401580cb4d54c404fafd91a696ec009d2388b354ffb05424c8af0f2fbe"
            },
            "downloads": -1,
            "filename": "ocr_tamil-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "422da6bab342c4b535e79f372587c5dd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 50174,
            "upload_time": "2025-09-06T21:55:43",
            "upload_time_iso_8601": "2025-09-06T21:55:43.956744Z",
            "url": "https://files.pythonhosted.org/packages/ad/c9/70f6d7375b8a219c67df9262ba0cc9566f878ec113f919f5e614e5707fe1/ocr_tamil-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0a2b61628274b8ff4e1b3372c061932fd0b5a983a07da57ffbdd9f4086980ae1",
                "md5": "7732ffc4e32377528106099dea90161f",
                "sha256": "107b9addb6715694b821997e9e579afb36da01798e45a5f0589de9e443988d53"
            },
            "downloads": -1,
            "filename": "ocr_tamil-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7732ffc4e32377528106099dea90161f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 43781,
            "upload_time": "2025-09-06T21:55:45",
            "upload_time_iso_8601": "2025-09-06T21:55:45.383881Z",
            "url": "https://files.pythonhosted.org/packages/0a/2b/61628274b8ff4e1b3372c061932fd0b5a983a07da57ffbdd9f4086980ae1/ocr_tamil-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-06 21:55:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gnana70",
    "github_project": "tamil_ocr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "aiohappyeyeballs",
            "specs": [
                [
                    "==",
                    "2.6.1"
                ]
            ]
        },
        {
            "name": "aiohttp",
            "specs": [
                [
                    "==",
                    "3.12.15"
                ]
            ]
        },
        {
            "name": "aiosignal",
            "specs": [
                [
                    "==",
                    "1.4.0"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "25.3.0"
                ]
            ]
        },
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    "==",
                    "4.13.5"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2025.8.3"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.4.3"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "contourpy",
            "specs": [
                [
                    "==",
                    "1.3.3"
                ]
            ]
        },
        {
            "name": "cycler",
            "specs": [
                [
                    "==",
                    "0.12.1"
                ]
            ]
        },
        {
            "name": "filelock",
            "specs": [
                [
                    "==",
                    "3.19.1"
                ]
            ]
        },
        {
            "name": "fonttools",
            "specs": [
                [
                    "==",
                    "4.59.2"
                ]
            ]
        },
        {
            "name": "frozenlist",
            "specs": [
                [
                    "==",
                    "1.7.0"
                ]
            ]
        },
        {
            "name": "fsspec",
            "specs": [
                [
                    "==",
                    "2025.9.0"
                ]
            ]
        },
        {
            "name": "gdown",
            "specs": [
                [
                    "==",
                    "5.2.0"
                ]
            ]
        },
        {
            "name": "huggingface-hub",
            "specs": [
                [
                    "==",
                    "0.34.4"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.10"
                ]
            ]
        },
        {
            "name": "imageio",
            "specs": [
                [
                    "==",
                    "2.37.0"
                ]
            ]
        },
        {
            "name": "jinja2",
            "specs": [
                [
                    "==",
                    "3.1.6"
                ]
            ]
        },
        {
            "name": "kiwisolver",
            "specs": [
                [
                    "==",
                    "1.4.9"
                ]
            ]
        },
        {
            "name": "lazy-loader",
            "specs": [
                [
                    "==",
                    "0.4"
                ]
            ]
        },
        {
            "name": "lightning-utilities",
            "specs": [
                [
                    "==",
                    "0.15.2"
                ]
            ]
        },
        {
            "name": "markupsafe",
            "specs": [
                [
                    "==",
                    "3.0.2"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    "==",
                    "3.10.6"
                ]
            ]
        },
        {
            "name": "mpmath",
            "specs": [
                [
                    "==",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "multidict",
            "specs": [
                [
                    "==",
                    "6.6.4"
                ]
            ]
        },
        {
            "name": "networkx",
            "specs": [
                [
                    "==",
                    "3.5"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "2.2.6"
                ]
            ]
        },
        {
            "name": "open-tamil",
            "specs": [
                [
                    "==",
                    "1.1"
                ]
            ]
        },
        {
            "name": "opencv-python",
            "specs": [
                [
                    "==",
                    "4.12.0.88"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "25.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.3.2"
                ]
            ]
        },
        {
            "name": "pillow",
            "specs": [
                [
                    "==",
                    "11.3.0"
                ]
            ]
        },
        {
            "name": "propcache",
            "specs": [
                [
                    "==",
                    "0.3.2"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "3.2.3"
                ]
            ]
        },
        {
            "name": "pysocks",
            "specs": [
                [
                    "==",
                    "1.7.1"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "pytorch-lightning",
            "specs": [
                [
                    "==",
                    "2.5.5"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2025.2"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.2"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.5"
                ]
            ]
        },
        {
            "name": "safetensors",
            "specs": [
                [
                    "==",
                    "0.6.2"
                ]
            ]
        },
        {
            "name": "scikit-image",
            "specs": [
                [
                    "==",
                    "0.25.2"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    "==",
                    "1.16.1"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.17.0"
                ]
            ]
        },
        {
            "name": "soupsieve",
            "specs": [
                [
                    "==",
                    "2.8"
                ]
            ]
        },
        {
            "name": "sympy",
            "specs": [
                [
                    "==",
                    "1.14.0"
                ]
            ]
        },
        {
            "name": "tifffile",
            "specs": [
                [
                    "==",
                    "2025.8.28"
                ]
            ]
        },
        {
            "name": "timm",
            "specs": [
                [
                    "==",
                    "1.0.10"
                ]
            ]
        },
        {
            "name": "torch",
            "specs": [
                [
                    "==",
                    "2.8.0"
                ]
            ]
        },
        {
            "name": "torchmetrics",
            "specs": [
                [
                    "==",
                    "1.8.2"
                ]
            ]
        },
        {
            "name": "torchvision",
            "specs": [
                [
                    "==",
                    "0.23.0"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": [
                [
                    "==",
                    "4.67.1"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.15.0"
                ]
            ]
        },
        {
            "name": "tzdata",
            "specs": [
                [
                    "==",
                    "2025.2"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.5.0"
                ]
            ]
        },
        {
            "name": "yarl",
            "specs": [
                [
                    "==",
                    "1.20.1"
                ]
            ]
        }
    ],
    "lcname": "ocr-tamil"
}
        
Elapsed time: 1.62543s