antonbol commited on
Commit
02ce498
1 Parent(s): 61e451d

change to img return

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -37,7 +37,7 @@ def titanic(pclass, name, sex, age, sibsp, parch, ticket, fare, cabin, embarked)
37
  # the first element.
38
 
39
  img = Image.open(leo_url) if res == 0 else Image.open(rose_url)
40
- return res
41
 
42
  demo = gr.Interface(
43
  fn=titanic,
@@ -56,6 +56,7 @@ demo = gr.Interface(
56
  gr.inputs.Textbox(default="A123", label="Cabin"),
57
  gr.inputs.Textbox(default="S", label="Embarked: [S, C, Q]")
58
  ],
59
- outputs=gr.Number())
 
60
 
61
  demo.launch()
 
37
  # the first element.
38
 
39
  img = Image.open(leo_url) if res == 0 else Image.open(rose_url)
40
+ return img
41
 
42
  demo = gr.Interface(
43
  fn=titanic,
 
56
  gr.inputs.Textbox(default="A123", label="Cabin"),
57
  gr.inputs.Textbox(default="S", label="Embarked: [S, C, Q]")
58
  ],
59
+ # outputs=gr.Number())
60
+ outputs=gr.Image(type="pil")
61
 
62
  demo.launch()