GianlucaRub commited on
Commit
645a761
·
1 Parent(s): 580cff5

changed res[0] to string

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -48,10 +48,11 @@ def passenger(Pclass, Age, SibSp, Parch, Fare, Sex, Embarked):
48
  input_list.append(1)
49
 
50
  # 'res' is a list of predictions returned as the label.
51
- res = model.predict(np.asarray(input_list).reshape(1, -1))
 
52
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
53
  # the first element.
54
- passenger_url = "https://raw.githubusercontent.com/GianlucaRub/Scalable-Machine-Learning-and-Deep-Learning/main/lab1/assets/" + res[0] + ".png"
55
  img = Image.open(requests.get(passenger_url, stream=True).raw)
56
  return img
57
 
 
48
  input_list.append(1)
49
 
50
  # 'res' is a list of predictions returned as the label.
51
+ res = model.predict(np.asarray(input_list).reshape(1, -1))
52
+ res = str(res[0])
53
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
54
  # the first element.
55
+ passenger_url = "https://raw.githubusercontent.com/GianlucaRub/Scalable-Machine-Learning-and-Deep-Learning/main/lab1/assets/" + res + ".png"
56
  img = Image.open(requests.get(passenger_url, stream=True).raw)
57
  return img
58