Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -82,7 +82,7 @@ def inference(filepath, lang, labels):
|
|
82 |
out = recognitor.predict(cropped_image)
|
83 |
texts = texts + '\t' + out
|
84 |
result = query(texts, labels)
|
85 |
-
jsonText = json.dumps(result
|
86 |
im = PIL.Image.open(filepath)
|
87 |
draw_boxes(im, bounds)
|
88 |
im.save('result.jpg')
|
@@ -98,7 +98,7 @@ choices = [
|
|
98 |
gr.Interface(
|
99 |
inference,
|
100 |
[gr.inputs.Image(type='filepath', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['vi'], label='language'), gr.inputs.Textbox(label='Labels',default='NgΖ°α»i nα»p, TiαΊΏp nhαΊn hα» sΖ‘ của')],
|
101 |
-
[gr.outputs.Image(type='pil', label='Output'), gr.outputs.Textbox(label='Text'), gr.outputs.
|
102 |
title=title,
|
103 |
description=description,
|
104 |
article=article,
|
|
|
82 |
out = recognitor.predict(cropped_image)
|
83 |
texts = texts + '\t' + out
|
84 |
result = query(texts, labels)
|
85 |
+
jsonText = json.dumps(result)
|
86 |
im = PIL.Image.open(filepath)
|
87 |
draw_boxes(im, bounds)
|
88 |
im.save('result.jpg')
|
|
|
98 |
gr.Interface(
|
99 |
inference,
|
100 |
[gr.inputs.Image(type='filepath', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['vi'], label='language'), gr.inputs.Textbox(label='Labels',default='NgΖ°α»i nα»p, TiαΊΏp nhαΊn hα» sΖ‘ của')],
|
101 |
+
[gr.outputs.Image(type='pil', label='Output'), gr.outputs.Textbox(label='Text'), gr.outputs.JSON(label='document')],
|
102 |
title=title,
|
103 |
description=description,
|
104 |
article=article,
|