Update app.py
Browse files
app.py
CHANGED
@@ -13,22 +13,17 @@ def classify_image(input):
|
|
13 |
return {prediction["label"]: prediction["score"] for prediction in predictions}
|
14 |
|
15 |
|
|
|
16 |
import gradio as gr
|
17 |
|
18 |
-
ex=[['cat2.jpg'],
|
19 |
-
['dog2.jpeg'],
|
20 |
-
['cat3.jpg'],
|
21 |
-
['dog.jpeg']]
|
22 |
-
|
23 |
-
ex = []
|
24 |
-
|
25 |
-
"""
|
26 |
-
## RUNNING WEB UI"""
|
27 |
-
|
28 |
image = gr.Image()
|
29 |
label = gr.Label(num_top_classes=5)
|
30 |
|
31 |
-
description = "Categories: " + "
|
|
|
|
|
32 |
|
33 |
gr.Interface(fn=classify_image, inputs=image, outputs=label, title='Human Action Recognition',
|
34 |
-
description=description, examples=
|
|
|
|
|
|
13 |
return {prediction["label"]: prediction["score"] for prediction in predictions}
|
14 |
|
15 |
|
16 |
+
# RUNNING WEB UI
|
17 |
import gradio as gr
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
image = gr.Image()
|
20 |
label = gr.Label(num_top_classes=5)
|
21 |
|
22 |
+
description = "## Categories: \n" + ", ".join(pipe.model.config.label2id.keys())
|
23 |
+
examples = [["samples/cycling.jpg"], ["samples/dancing.webp"] ["samples/running.jpg"] ["samples/sleeping.webp"]]
|
24 |
+
theme = gr.themes.Default(primary_hue="red", secondary_hue="pink")
|
25 |
|
26 |
gr.Interface(fn=classify_image, inputs=image, outputs=label, title='Human Action Recognition',
|
27 |
+
description=description, examples=examples, theme=theme
|
28 |
+
).launch(height=1000, width=1600, debug=True, share=True)
|
29 |
+
|