bhushanp commited on
Commit
5993fff
β€’
1 Parent(s): 04f6df4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -26,7 +26,8 @@ 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[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,7 +35,7 @@ sample_images = ["./sample_images/AcuraTLType-S2008.jpg", "./sample_images/AudiR
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",
 
26
  # Make a prediction
27
  # Decode the prediction and get the class name
28
  name = learn.predict(image)
29
+ return name[:-4], name[-4:]
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
  iface = gr.Interface(
36
  fn=classify_image,
37
  inputs=gr.Image(label="Select an image", type="filepath"),
38
+ outputs=[gr.Textbox(label="Name"), gr.Textbox(label="Year")],
39
  live=False,
40
  title="Car image classifier",
41
  description="Upload a car image or select one of the examples below",