Zeeshan42 commited on
Commit
8c66782
·
verified ·
1 Parent(s): 2cc4c17

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import easyocr
3
+ from PIL import Image
4
+ import numpy as np
5
+
6
+ reader = easyocr.Reader(['en'])
7
+ def extract_text(image):
8
+ image = np.array(image)
9
+ result = reader.readtext(image, detail=0)
10
+ return " ".join(result) if result else "Could not read CAPTCHA"
11
+
12
+ iface = gr.Interface(
13
+ fn=extract_text,
14
+ inputs=gr.Image(type="pil"),
15
+ outputs="text",
16
+ title="CAPTCHA Reader Chatbot",
17
+ description="Upload a CAPTCHA image, and I'll tell you what's written on it!"
18
+ )
19
+
20
+ iface.launch(share=True)