Spaces:
Runtime error
Runtime error
Rehman1603
commited on
Commit
•
3139b67
1
Parent(s):
79b7116
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,11 @@ import easyocr
|
|
3 |
import gradio as gr
|
4 |
from main import predict_mcq
|
5 |
|
6 |
-
|
7 |
def ocr_with_easy(image):
|
8 |
#gray_scale_image=get_grayscale(img)
|
9 |
#thresholding(gray_scale_image)
|
10 |
cv2.imwrite('image.png',image)
|
11 |
-
reader = easyocr.Reader(['th','en'])
|
12 |
bounds = reader.readtext(image,paragraph="False",detail = 0)
|
13 |
bounds = ''.join(bounds)
|
14 |
return bounds
|
@@ -33,5 +32,6 @@ def MCQGenerator(image):
|
|
33 |
final_result=put_in_single_list(data)
|
34 |
return final_result
|
35 |
|
36 |
-
iface=gr.Interface(fn=MCQGenerator,inputs="image",outputs=[gr.components.Textbox(label="MCQS")]
|
|
|
37 |
iface.launch(debug=True)
|
|
|
3 |
import gradio as gr
|
4 |
from main import predict_mcq
|
5 |
|
6 |
+
reader = easyocr.Reader(['th','en'])
|
7 |
def ocr_with_easy(image):
|
8 |
#gray_scale_image=get_grayscale(img)
|
9 |
#thresholding(gray_scale_image)
|
10 |
cv2.imwrite('image.png',image)
|
|
|
11 |
bounds = reader.readtext(image,paragraph="False",detail = 0)
|
12 |
bounds = ''.join(bounds)
|
13 |
return bounds
|
|
|
32 |
final_result=put_in_single_list(data)
|
33 |
return final_result
|
34 |
|
35 |
+
iface=gr.Interface(fn=MCQGenerator,inputs="image",outputs=[gr.components.Textbox(label="MCQS")],
|
36 |
+
examples=[['demo.PNG']])
|
37 |
iface.launch(debug=True)
|