Spaces:
Running
Running
ovi054
commited on
Commit
·
53ac577
1
Parent(s):
1b412bd
New Output Field Support
Browse files
app.py
CHANGED
|
@@ -553,7 +553,7 @@ def model_predict(word):
|
|
| 553 |
draw.rectangle(bbox, fill=(200, 100, 0, 200))
|
| 554 |
draw.text(pt1, classi, font=font, fill=(0,0,0,255))
|
| 555 |
newWordImg = np.asarray(pil_image)
|
| 556 |
-
return
|
| 557 |
'''
|
| 558 |
output=''
|
| 559 |
for i in range(0,len(final)):
|
|
@@ -571,8 +571,7 @@ def model_predict(word):
|
|
| 571 |
|
| 572 |
import gradio as gr
|
| 573 |
HF_TOKEN = os.getenv("HF_TOKEN", default ="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")
|
| 574 |
-
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "
|
| 575 |
-
|
| 576 |
-
demo = gr.Interface(fn=model_predict, inputs= "paint", outputs=["image","text"],allow_flagging="auto",flagging_callback=hf_writer)
|
| 577 |
|
|
|
|
| 578 |
demo.launch()
|
|
|
|
| 553 |
draw.rectangle(bbox, fill=(200, 100, 0, 200))
|
| 554 |
draw.text(pt1, classi, font=font, fill=(0,0,0,255))
|
| 555 |
newWordImg = np.asarray(pil_image)
|
| 556 |
+
return output, newWordImg
|
| 557 |
'''
|
| 558 |
output=''
|
| 559 |
for i in range(0,len(final)):
|
|
|
|
| 571 |
|
| 572 |
import gradio as gr
|
| 573 |
HF_TOKEN = os.getenv("HF_TOKEN", default ="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")
|
| 574 |
+
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "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")
|
|
|
|
|
|
|
| 575 |
|
| 576 |
+
demo = gr.Interface(fn=model_predict, inputs= "paint", outputs=["text","image"],allow_flagging="auto",flagging_callback=hf_writer)
|
| 577 |
demo.launch()
|