Spaces:
Sleeping
Sleeping
File size: 527 Bytes
8c66782 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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)
|