Downloads · 30 days
104
3% of all-time downloads
zenoda/trocr-captcha-killer
trocr-captcha-killer is a image-text-to-text model from zenoda. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
104
3% of all-time downloads
All-time downloads
3.5K
Public
Repo size
741 MB
Likes
4
Public
Click a slice to open those files.
.bin247 MB · 98%
From the Hugging Face model README
accuracy: 0.937338
from transformers import VisionEncoderDecoderModel, TrOCRProcessor
from PIL import Image
import requests
processor = TrOCRProcessor.from_pretrained("zenoda/trocr-captcha-killer")
model = VisionEncoderDecoderModel.from_pretrained("zenoda/trocr-captcha-killer")
model.to('cuda')
url = 'https://huggingface.co/datasets/zenoda/trocr-captcha-killer/resolve/main/106-1688354008849.png'
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
generated_ids = model.generate(processor(image, return_tensors="pt").pixel_values.to('cuda'))
predictText = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(predictText)