Arnav Raina
commited on
Commit
·
3300af1
1
Parent(s):
895bd1f
Update app.py
Browse files
app.py
CHANGED
@@ -16,18 +16,20 @@ def detect(files):
|
|
16 |
pred_ct = res["PRED_CT"],
|
17 |
geo_tag_url = res["GEO_TAG_URL"]
|
18 |
PRED.append(pred_ct)
|
19 |
-
|
|
|
|
|
20 |
|
21 |
with gr.Blocks() as demo:
|
|
|
22 |
with gr.Row():
|
23 |
-
|
24 |
-
with gr.Row():
|
25 |
-
# text = gr.Textbox(show_label=False, elem_id="result-textarea")
|
26 |
-
btn = gr.UploadButton(
|
27 |
label="Upload Image",
|
28 |
file_types=[".jpg",".jpeg"],
|
29 |
file_count="multiple")
|
30 |
-
btn.upload(fn=detect, inputs=btn, outputs=[gr.Textbox(show_label=False, elem_id="result-textarea")], api_name="predict")
|
31 |
-
# put gr.Label() in upload(outputs=gr.Label())
|
32 |
|
33 |
-
|
|
|
|
|
|
|
|
|
|
16 |
pred_ct = res["PRED_CT"],
|
17 |
geo_tag_url = res["GEO_TAG_URL"]
|
18 |
PRED.append(pred_ct)
|
19 |
+
|
20 |
+
print(res["PRED_CT"])
|
21 |
+
return res["PRED_CT"]
|
22 |
|
23 |
with gr.Blocks() as demo:
|
24 |
+
gr.Markdown("# DetectIt")
|
25 |
with gr.Row():
|
26 |
+
image = gr.UploadButton(
|
|
|
|
|
|
|
27 |
label="Upload Image",
|
28 |
file_types=[".jpg",".jpeg"],
|
29 |
file_count="multiple")
|
|
|
|
|
30 |
|
31 |
+
btn = gr.Button("Go")
|
32 |
+
text = gr.Textbox(show_label=False, elem_id="result-textarea")
|
33 |
+
btn.click(detect, inputs=[image], outputs=[text], api_name="predict")
|
34 |
+
|
35 |
+
demo.launch(share=True)
|