Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,18 +29,25 @@ def classify_image(inp):
|
|
29 |
return {LABELS[i]: float(f"{prediction[0][i]:.6f}") for i in range(NUM_CLASSES)}
|
30 |
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
iface = gr.Interface(
|
34 |
fn=classify_image,
|
35 |
inputs=gr.Image(
|
36 |
label="Input Image",
|
37 |
-
|
38 |
-
type="numpy",
|
39 |
-
height=HEIGHT,
|
40 |
-
width=WIDTH
|
41 |
),
|
42 |
outputs=gr.Label(num_top_classes=4),
|
43 |
-
title="Brand Logo Detection"
|
|
|
44 |
)
|
45 |
|
46 |
if __name__ == "__main__":
|
|
|
29 |
return {LABELS[i]: float(f"{prediction[0][i]:.6f}") for i in range(NUM_CLASSES)}
|
30 |
|
31 |
|
32 |
+
example_list = [
|
33 |
+
["Examples/Untitled.png"],
|
34 |
+
["Examples/Untitled2.png"],
|
35 |
+
["Examples/Untitled3.png"],
|
36 |
+
["Examples/Untitled5.png"]
|
37 |
+
]
|
38 |
+
|
39 |
iface = gr.Interface(
|
40 |
fn=classify_image,
|
41 |
inputs=gr.Image(
|
42 |
label="Input Image",
|
43 |
+
source="upload",
|
44 |
+
type="numpy",
|
45 |
+
height=HEIGHT,
|
46 |
+
width=WIDTH
|
47 |
),
|
48 |
outputs=gr.Label(num_top_classes=4),
|
49 |
+
title="Brand Logo Detection",
|
50 |
+
examples=example_list
|
51 |
)
|
52 |
|
53 |
if __name__ == "__main__":
|