Downloads · 30 days
183
9% of all-time downloads
sabaridsnfuji/Tamil_Offline_Handwritten_OCR
Tamil_Offline_Handwritten_OCR is a machine learning model from sabaridsnfuji. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This model is a Vision Encoder-Decoder-based OCR model for recognizing Tamil text from images. The encoder uses a Vision Transformer (ViT) architecture, and the decoder is based on a pre-trained Tamil RoBERTa model. T…
Downloads · 30 days
183
9% of all-time downloads
All-time downloads
2.1K
Public
Parameters
168M
2 GB on disk
Likes
3
Public
Click a slice to open those files.
.pt1.3 GB · 67%
From the Hugging Face model README
This model is a Vision Encoder-Decoder-based OCR model for recognizing Tamil text from images. The encoder uses a Vision Transformer (ViT) architecture, and the decoder is based on a pre-trained Tamil RoBERTa model. The model is capable of processing image inputs and generating corresponding text, specifically optimized for Tamil script.
Encoder: google/vit-base-patch16-224-in21k
Decoder: d42kw01f/Tamil-RoBERTa
The model is designed to perform Optical Character Recognition (OCR) on images containing Tamil text. Some potential use cases include:
You can use this model with Hugging Face's transformers library to extract text from images. Below is a sample usage script:
from PIL import Image
from transformers import AutoFeatureExtractor, AutoTokenizer, TrOCRProcessor, VisionEncoderDecoderModel
# Load the model and processor
encoder_model = 'google/vit-base-patch16-224-in21k'
decoder_model = 'd42kw01f/Tamil-RoBERTa'
trained_model_path = '.model/' # Path to the fine-tuned model
# Initialize the processor and model
feature_extractor = AutoFeatureExtractor.from_pretrained(encoder_model)
tokenizer = AutoTokenizer.from_pretrained(decoder_model)
processor = TrOCRProcessor(feature_extractor=feature_extractor, tokenizer=tokenizer)
model = VisionEncoderDecoderModel.from_pretrained(trained_model_path)
# Load and preprocess the image
image_path = 'path_to_your_image.jpg'
image = Image.open(image_path).convert('RGB')
# Generate text
pixel_values = processor(image, return_tensors='pt').pixel_values
generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print("Generated Text:", generated_text)
.jpg, .png, and .jpeg.# Input: Image containing Tamil text.
# Output: Extracted text from the image.
5e-5.The model was evaluated using standard OCR benchmarks with an emphasis on Tamil text recognition. The primary evaluation metric was character-level accuracy and Word Error Rate (WER).
This model, while useful for Tamil text extraction, should be applied with caution in contexts where incorrect text extraction could lead to harmful outcomes, such as legal or medical document analysis.
This model is distributed under the MIT license. Please check the Hugging Face repository for specific terms.
widget: