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)
Runs of anuashok ocr-captcha-v1 on huggingface.co
32
Total runs
2
24-hour runs
4
3-day runs
2
7-day runs
-133
30-day runs
More Information About ocr-captcha-v1 huggingface.co Model
ocr-captcha-v1 huggingface.co
ocr-captcha-v1 huggingface.co is an AI model on huggingface.co that provides ocr-captcha-v1's model effect (), which can be used instantly with this anuashok ocr-captcha-v1 model. huggingface.co supports a free trial of the ocr-captcha-v1 model, and also provides paid use of the ocr-captcha-v1. Support call ocr-captcha-v1 model through api, including Node.js, Python, http.
ocr-captcha-v1 huggingface.co is an online trial and call api platform, which integrates ocr-captcha-v1's modeling effects, including api services, and provides a free online trial of ocr-captcha-v1, you can try ocr-captcha-v1 online for free by clicking the link below.
anuashok ocr-captcha-v1 online free url in huggingface.co:
ocr-captcha-v1 is an open source model from GitHub that offers a free installation service, and any user can find ocr-captcha-v1 on GitHub to install. At the same time, huggingface.co provides the effect of ocr-captcha-v1 install, users can directly use ocr-captcha-v1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.