Downloads · 30 days
34
1% of all-time downloads
anuashok/ocr-captcha-v1
ocr-captcha-v1 is a machine learning model from anuashok. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a fine-tuned version of microsoft/trocr-base-printed on your custom dataset.
Downloads · 30 days
34
1% of all-time downloads
All-time downloads
3.1K
Public
Parameters
334M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of microsoft/trocr-base-printed on your custom dataset.

from transformers import VisionEncoderDecoderModel, TrOCRProcessor
import torch
from PIL import Image
# Load model and processor
processor = TrOCRProcessor.from_pretrained("anuashok/ocr-captcha-1")
model = VisionEncoderDecoderModel.from_pretrained("anuashok/ocr-captcha-1")
# Load image
image = Image.open('path_to_your_image.jpg').convert("RGB")
# Prepare image
pixel_values = processor(image, return_tensors="pt").pixel_values
# Generate text
generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_text)