Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Hindi Language support not working

Open
#2,017 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
15/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, pytorch

Research direction

The report concerns loading a custom Hindi vocab and a locally downloaded crnn_vgg16_bn checkpoint into the ocr_predictor pipeline, so the relevant code is the recognition model construction and state-dict loading in doctr's models package. Reproduce with a Hindi sample image and check whether the predictor output is empty because of the vocab mismatch or the detection step. Done would mean Hindi text is recognized from a documented setup; no comments or linked work exist, so the maintainers' stance is unknown.

Written by the indexing model from the issue text.

Description

from doctr.models import ocr_predictor, crnn_vgg16_bn, db_resnet50
from doctr.io import DocumentFile
from doctr.datasets import VOCABS

# Vocab copied from the indic-doctr repo
vocab = 'ॲऽऐथफएऎह८॥ॉम९ुँ१ं।षघठर॓ॼड़गछिॱटऩॄऑवल५ढ़य़अञसऔयण॑क़॒ौॽशऍ॰ूीऒॊख़उज़ॻॅ३ओऌळनॠ०ेढङ४़ॢग़पऊॐज२डैभझकआदबऋखॾ॔ोइ्धतफ़ईृःा६चऱऴ७-'
reco_model = crnn_vgg16_bn(pretrained=False, pretrained_backbone=False, vocab=vocab)
# Download: https://github.com/iitb-research-code/indic-doctr/releases/download/model2/crnn_vgg16_bn_hindi.pt
local_model_path = "crnn_vgg16_bn_hindi.pt"
reco_params = torch.load(local_model_path, map_location="cpu")
reco_model.load_state_dict(reco_params)

predictor = ocr_predictor(det_arch='db_resnet50',reco_arch=reco_model, pretrained=True)

single_img_doc = DocumentFile.from_images("0022-0024_3_5_2.jpg")
result = predictor(single_img_doc)
print(result.pages[0].export())  # print the result of the first page as a list of  #dicts```

I got an empty array with no output for a Hindi image. How to fix? Please help. 

Originally posted by @manit2004 in #1617

Dominant language
Python
Stars
6.4k
Forks
684
Avg merge
20h 40m
Merged PRs (30d)
30

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mindee/doctr

All issues in mindee/doctr

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.