Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
•
b971bf6
1
Parent(s):
00a057f
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import gradio as gr
|
|
7 |
import torch
|
8 |
ocr = PaddleOCR(use_angle_cls=True, lang='en',use_gpu=False)
|
9 |
|
10 |
-
torch.hub.download_url_to_file('https://
|
11 |
|
12 |
def inference(img):
|
13 |
img_path = img.name
|
@@ -25,7 +25,7 @@ def inference(img):
|
|
25 |
title = 'PaddleOCR'
|
26 |
description = 'Gradio demo for PaddleOCR. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below.'
|
27 |
article = "<p style='text-align: center'><a href='https://www.paddlepaddle.org.cn/hub/scene/ocr'>Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)</a> | <a href='https://github.com/PaddlePaddle/PaddleOCR'>Github Repo</a></p>"
|
28 |
-
examples = [['
|
29 |
gr.Interface(
|
30 |
inference,
|
31 |
gr.inputs.Image(type='file', label='Input'),
|
|
|
7 |
import torch
|
8 |
ocr = PaddleOCR(use_angle_cls=True, lang='en',use_gpu=False)
|
9 |
|
10 |
+
torch.hub.download_url_to_file('https://i.imgur.com/2sylF76.jpg', 'example.jpg')
|
11 |
|
12 |
def inference(img):
|
13 |
img_path = img.name
|
|
|
25 |
title = 'PaddleOCR'
|
26 |
description = 'Gradio demo for PaddleOCR. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below.'
|
27 |
article = "<p style='text-align: center'><a href='https://www.paddlepaddle.org.cn/hub/scene/ocr'>Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)</a> | <a href='https://github.com/PaddlePaddle/PaddleOCR'>Github Repo</a></p>"
|
28 |
+
examples = [['example.jpg']]
|
29 |
gr.Interface(
|
30 |
inference,
|
31 |
gr.inputs.Image(type='file', label='Input'),
|