Hoft commited on
Commit
d7d4a58
1 Parent(s): 3844499

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -29,7 +29,7 @@ def titanic(pclass, sex, age, fare):
29
  # the first element.
30
  image_url = "https://raw.githubusercontent.com/xrisaD/ScalableML-Titanic/main/images/" + str(res[0]) + ".jpg"
31
  img = Image.open(requests.get(image_url, stream=True).raw)
32
- return img #res[0]
33
 
34
  demo = gr.Interface(
35
  fn=titanic,
@@ -37,12 +37,11 @@ demo = gr.Interface(
37
  description="Experiment with titanic features to predict if passanger survived.",
38
  allow_flagging="never",
39
  inputs=[
40
- gr.inputs.Dropdown(label="Passanger Class", choices = [1, 2, 3]),
41
- gr.inputs.Dropdown(label="Sex", choices=["Female", "Male"], type="index"),
42
- gr.inputs.Dropdown(label="Age", choices=['0-21', '22-25', '26-40', '41-80', 'unknown'], type="index"),
43
  gr.inputs.Slider(minimum=0, maximum=600, default=50, label="Fare"),
44
  ],
45
- outputs=gr.Image(type="pil")) #gr.inputs.Number(label="Survived"))
46
 
47
  demo.launch()
48
-
 
29
  # the first element.
30
  image_url = "https://raw.githubusercontent.com/xrisaD/ScalableML-Titanic/main/images/" + str(res[0]) + ".jpg"
31
  img = Image.open(requests.get(image_url, stream=True).raw)
32
+ return img
33
 
34
  demo = gr.Interface(
35
  fn=titanic,
 
37
  description="Experiment with titanic features to predict if passanger survived.",
38
  allow_flagging="never",
39
  inputs=[
40
+ gr.inputs.Dropdown(default=1, label="Passanger Class", choices = [1, 2, 3]),
41
+ gr.inputs.Dropdown(default="Female", label="Sex", choices=["Female", "Male"], type="index"),
42
+ gr.inputs.Dropdown(default="0-21", label="Age", choices=['0-21', '22-25', '26-40', '41-80', 'unknown'], type="index"),
43
  gr.inputs.Slider(minimum=0, maximum=600, default=50, label="Fare"),
44
  ],
45
+ outputs=gr.Image(type="pil"))
46
 
47
  demo.launch()