Spaces:
Runtime error
Runtime error
First model version
Browse files
app.py
CHANGED
@@ -19,7 +19,9 @@ from utils import Config, Logger, CharsetMapper
|
|
19 |
import torch
|
20 |
|
21 |
|
22 |
-
def infer(
|
|
|
|
|
23 |
config = Config('configs/rec/train_abinet.yaml')
|
24 |
config.model_vision_checkpoint = None
|
25 |
model = get_model(config)
|
@@ -53,7 +55,7 @@ def infer(filepath):
|
|
53 |
|
54 |
blocks = gr.Blocks()
|
55 |
|
56 |
-
input_image = gr.Image(label="image", type="
|
57 |
output_image = gr.Image(label="out_img", type="filepath")
|
58 |
output_word = gr.Dataframe(label="out_word", headers=['word'])
|
59 |
|
|
|
19 |
import torch
|
20 |
|
21 |
|
22 |
+
def infer(img):
|
23 |
+
filepath = './input.png'
|
24 |
+
img.save(filepath)
|
25 |
config = Config('configs/rec/train_abinet.yaml')
|
26 |
config.model_vision_checkpoint = None
|
27 |
model = get_model(config)
|
|
|
55 |
|
56 |
blocks = gr.Blocks()
|
57 |
|
58 |
+
input_image = gr.Image(label="image", type="pil")
|
59 |
output_image = gr.Image(label="out_img", type="filepath")
|
60 |
output_word = gr.Dataframe(label="out_word", headers=['word'])
|
61 |
|