Spaces:
Runtime error
Runtime error
First model version
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ import torch
|
|
22 |
def infer(filepath):
|
23 |
config = Config('configs/rec/train_abinet.yaml')
|
24 |
config.model_vision_checkpoint = None
|
25 |
-
model = get_model(config).
|
26 |
model = load(model, 'workdir/train-abinet/best-train-abinet.pth')
|
27 |
charset = CharsetMapper(filename=config.dataset_charset_path, max_length=config.dataset_max_length + 1)
|
28 |
|
@@ -58,6 +58,6 @@ iface = gr.Interface(
|
|
58 |
description="毕设题目:自然场景中任意形状文字的检测与识别\n目前进度:检测",
|
59 |
inputs=[gr.inputs.Image(label="image", type="filepath")],
|
60 |
outputs=[gr.outputs.Image(), gr.outputs.Dataframe(headers=['word'])], #
|
61 |
-
|
62 |
#article="<a href=\"https://github.com/MhLiao/MaskTextSpotterV3\">GitHub Repo</a>",
|
63 |
-
).launch(enable_queue=True)
|
|
|
22 |
def infer(filepath):
|
23 |
config = Config('configs/rec/train_abinet.yaml')
|
24 |
config.model_vision_checkpoint = None
|
25 |
+
model = get_model(config).to('cuda')
|
26 |
model = load(model, 'workdir/train-abinet/best-train-abinet.pth')
|
27 |
charset = CharsetMapper(filename=config.dataset_charset_path, max_length=config.dataset_max_length + 1)
|
28 |
|
|
|
58 |
description="毕设题目:自然场景中任意形状文字的检测与识别\n目前进度:检测",
|
59 |
inputs=[gr.inputs.Image(label="image", type="filepath")],
|
60 |
outputs=[gr.outputs.Image(), gr.outputs.Dataframe(headers=['word'])], #
|
61 |
+
examples=['figs/test/CANDY.png', 'figs/test/ESPLANADE.png', 'figs/test/KAPPA.png'],
|
62 |
#article="<a href=\"https://github.com/MhLiao/MaskTextSpotterV3\">GitHub Repo</a>",
|
63 |
+
).launch(enable_queue=True, cache_examples=True)
|