Spaces:
Runtime error
Runtime error
Commit
·
c32777e
1
Parent(s):
cd480d9
adf
Browse files
app.py
CHANGED
@@ -110,8 +110,7 @@ def titanic(Pclass, Sex, Age, SibSp, Parch, Fare, Embarked):
|
|
110 |
generate_survivor_url).json()["image_url"]
|
111 |
|
112 |
survivor_url = randomized_face_url
|
113 |
-
img = Image.open(requests.get(survivor_url, stream=True).raw)
|
114 |
-
height='100', rounded=False)
|
115 |
|
116 |
#
|
117 |
red_cross_url = "https://www.iconsdb.com/icons/preview/red/x-mark-xxl.png"
|
@@ -125,8 +124,7 @@ def titanic(Pclass, Sex, Age, SibSp, Parch, Fare, Embarked):
|
|
125 |
url = label_to_url.get(survived)
|
126 |
|
127 |
# Save the image of the person
|
128 |
-
img2 = Image.open(requests.get(url, stream=True).raw)
|
129 |
-
height='100', rounded=False)
|
130 |
|
131 |
return img, img2
|
132 |
|
@@ -171,6 +169,8 @@ demo = gr.Interface(
|
|
171 |
description="Experiment with person features to predict which survivor it is.",
|
172 |
allow_flagging="never",
|
173 |
inputs=inputs,
|
174 |
-
outputs=[gr.Image(type="pil")
|
|
|
|
|
175 |
|
176 |
demo.launch()
|
|
|
110 |
generate_survivor_url).json()["image_url"]
|
111 |
|
112 |
survivor_url = randomized_face_url
|
113 |
+
img = Image.open(requests.get(survivor_url, stream=True).raw)
|
|
|
114 |
|
115 |
#
|
116 |
red_cross_url = "https://www.iconsdb.com/icons/preview/red/x-mark-xxl.png"
|
|
|
124 |
url = label_to_url.get(survived)
|
125 |
|
126 |
# Save the image of the person
|
127 |
+
img2 = Image.open(requests.get(url, stream=True).raw)
|
|
|
128 |
|
129 |
return img, img2
|
130 |
|
|
|
169 |
description="Experiment with person features to predict which survivor it is.",
|
170 |
allow_flagging="never",
|
171 |
inputs=inputs,
|
172 |
+
outputs=[gr.Image(type="pil").style(
|
173 |
+
height='100', rounded=False), gr.Image(type="pil").style(
|
174 |
+
height='100', rounded=False)])
|
175 |
|
176 |
demo.launch()
|