WayneLinn commited on
Commit
06cc37c
1 Parent(s): a8ec837

added label

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -62,10 +62,13 @@ def passenger(pclass,#index
62
  # the first element.
63
  if res==0:
64
  url="https://i.imgflip.com/5jvc2d.jpg"
 
65
  else:
 
66
  url="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTv3XuQKvjiF_ZpUt8rKlsVBX--JXMpfa674H03N-aApj_HjK1S"
67
  img = Image.open(requests.get(url, stream=True).raw) #get image from github
68
- return img
 
69
 
70
  #create hugging face interface
71
  demo = gr.Interface(
@@ -84,7 +87,7 @@ demo = gr.Interface(
84
  title="Titanic Survivor Predictive Analytics",
85
  description="Who could surive the titanic",
86
  allow_flagging="never",
87
- outputs=gr.Image(type="pil")
88
  )
89
 
90
  demo.launch()
 
62
  # the first element.
63
  if res==0:
64
  url="https://i.imgflip.com/5jvc2d.jpg"
65
+ text="Dead 110 years ago rip"
66
  else:
67
+ text="Dead but not on Titanic"
68
  url="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTv3XuQKvjiF_ZpUt8rKlsVBX--JXMpfa674H03N-aApj_HjK1S"
69
  img = Image.open(requests.get(url, stream=True).raw) #get image from github
70
+
71
+ return img,text
72
 
73
  #create hugging face interface
74
  demo = gr.Interface(
 
87
  title="Titanic Survivor Predictive Analytics",
88
  description="Who could surive the titanic",
89
  allow_flagging="never",
90
+ outputs=[gr.Image(type="pil"),gr.Label()]
91
  )
92
 
93
  demo.launch()