Spaces:
Sleeping
Sleeping
import gradio as gr | |
import easyocr | |
from PIL import Image | |
import numpy as np | |
reader = easyocr.Reader(['en']) | |
def extract_text(image): | |
image = np.array(image) | |
result = reader.readtext(image, detail=0) | |
return " ".join(result) if result else "Could not read CAPTCHA" | |
iface = gr.Interface( | |
fn=extract_text, | |
inputs=gr.Image(type="pil"), | |
outputs="text", | |
title="CAPTCHA Reader Chatbot", | |
description="Upload a CAPTCHA image, and I'll tell you what's written on it!" | |
) | |
iface.launch(share=True) | |