Update app.py
Browse files
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
|
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"))
|
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()
|
|