MaryDatascientist commited on
Commit
bd114fa
1 Parent(s): 9834061

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -32,9 +32,14 @@ def titanic(PassengerId, Pclass, Numeric_sex, Age, Fare):
32
  res = model.predict(np.asarray(input_list).reshape(1, -1))
33
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
34
  # the first element.
35
-
 
 
 
 
36
  #flower_url = "https://raw.githubusercontent.com/featurestoreorg/serverless-ml-course/main/src/01-module/assets/" + res[0] + ".png"
37
- img = Image.open("deadImage.png")#requests.get(flower_url, stream=True).raw)
 
38
  return img
39
 
40
  demo = gr.Interface(
 
32
  res = model.predict(np.asarray(input_list).reshape(1, -1))
33
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
34
  # the first element.
35
+ l = int(res)
36
+ if(l == 0):
37
+ img = Image.open("deadImage.png")
38
+ else:
39
+ img = Image.open("survivedImage.png")
40
  #flower_url = "https://raw.githubusercontent.com/featurestoreorg/serverless-ml-course/main/src/01-module/assets/" + res[0] + ".png"
41
+ # img = Image.open("deadImage.png")#requests.get(flower_url, stream=True).raw)
42
+
43
  return img
44
 
45
  demo = gr.Interface(