Update app.py
Browse files
app.py
CHANGED
@@ -24,12 +24,12 @@ def titanic(pclass, sex, age, sibs, par_ch, fare):
|
|
24 |
input_list.append(sibs)
|
25 |
input_list.append(par_ch)
|
26 |
input_list.append(fare)
|
27 |
-
input_list.
|
28 |
# 'res' is a list of predictions returned as the label.
|
29 |
res = model.predict(np.asarray(input_list).reshape(1, -1))
|
30 |
# We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
|
31 |
# the first element.
|
32 |
-
man_url = "https://raw.githubusercontent.com/Tilosmsh/IL2223_lab1/main/images/" + ("survived.jpg" if res[0] else "dead.jpg")
|
33 |
img = Image.open(requests.get(man_url, stream=True).raw)
|
34 |
return img
|
35 |
|
|
|
24 |
input_list.append(sibs)
|
25 |
input_list.append(par_ch)
|
26 |
input_list.append(fare)
|
27 |
+
input_list.extend(list(np.random.choice([0,1], 9)))
|
28 |
# 'res' is a list of predictions returned as the label.
|
29 |
res = model.predict(np.asarray(input_list).reshape(1, -1))
|
30 |
# We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
|
31 |
# the first element.
|
32 |
+
man_url = "https://raw.githubusercontent.com/Tilosmsh/IL2223_lab1/main/images/" + ("survived.jpg" if res[0]==1 else "dead.jpg")
|
33 |
img = Image.open(requests.get(man_url, stream=True).raw)
|
34 |
return img
|
35 |
|