Spaces:
Runtime error
Runtime error
sberbank-ai
commited on
Commit
•
703c829
1
Parent(s):
4bb3965
refactor: Minor refactor
Browse files
app.py
CHANGED
@@ -45,14 +45,13 @@ def predict(image_path):
|
|
45 |
return '\n'.join(result_text)
|
46 |
|
47 |
|
48 |
-
|
49 |
-
PIPELINE_CONFIG_PATH = get_config_and_download_weights("sberbank-ai/ReadingPipeline-Peter")
|
50 |
|
51 |
-
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
45 |
return '\n'.join(result_text)
|
46 |
|
47 |
|
48 |
+
PIPELINE_CONFIG_PATH = get_config_and_download_weights("sberbank-ai/ReadingPipeline-Peter")
|
|
|
49 |
|
50 |
+
PREDICTOR = PipelinePredictor(pipeline_config_path=PIPELINE_CONFIG_PATH)
|
51 |
|
52 |
+
gr.Interface(
|
53 |
+
predict,
|
54 |
+
inputs=gr.Image(label="Upload an image of Peter manuscript", type="filepath"),
|
55 |
+
outputs=gr.Textbox(label="Text on the image"),
|
56 |
+
title="Peter manuscript recognition",
|
57 |
+
).launch()
|