Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,8 +26,7 @@ def classify_image(image):
|
|
26 |
# Make a prediction
|
27 |
# Decode the prediction and get the class name
|
28 |
name = learn.predict(image)
|
29 |
-
return name[
|
30 |
-
|
31 |
|
32 |
# Sample images for user to choose from
|
33 |
sample_images = ["./sample_images/AcuraTLType-S2008.jpg", "./sample_images/AudiR8Coupe2012.jpg","./sample_images/DodgeMagnumWagon2008.jpg"]
|
@@ -35,7 +34,7 @@ sample_images = ["./sample_images/AcuraTLType-S2008.jpg", "./sample_images/AudiR
|
|
35 |
iface = gr.Interface(
|
36 |
fn=classify_image,
|
37 |
inputs=gr.Image(label="Select an image", type="filepath"),
|
38 |
-
outputs=
|
39 |
live=False,
|
40 |
title="Car image classifier",
|
41 |
description="Upload a car image or select one of the examples below",
|
@@ -43,4 +42,4 @@ iface = gr.Interface(
|
|
43 |
)
|
44 |
|
45 |
|
46 |
-
iface.launch()
|
|
|
26 |
# Make a prediction
|
27 |
# Decode the prediction and get the class name
|
28 |
name = learn.predict(image)
|
29 |
+
return name[0]
|
|
|
30 |
|
31 |
# Sample images for user to choose from
|
32 |
sample_images = ["./sample_images/AcuraTLType-S2008.jpg", "./sample_images/AudiR8Coupe2012.jpg","./sample_images/DodgeMagnumWagon2008.jpg"]
|
|
|
34 |
iface = gr.Interface(
|
35 |
fn=classify_image,
|
36 |
inputs=gr.Image(label="Select an image", type="filepath"),
|
37 |
+
outputs="text",
|
38 |
live=False,
|
39 |
title="Car image classifier",
|
40 |
description="Upload a car image or select one of the examples below",
|
|
|
42 |
)
|
43 |
|
44 |
|
45 |
+
iface.launch()
|