pleonard commited on
Commit
9aef8f7
1 Parent(s): 162c270

minor changes

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -109,6 +109,7 @@ with gr.Blocks() as demo:
109
  face_coordinates = (found_face["source_x"],found_face["source_y"], (found_face["source_x"] + found_face["source_w"]),(found_face["source_y"] + found_face["source_h"]))
110
  person = found_face["identity"].split("/")[1].replace("_"," ")
111
  face_confidence = "Matched " + person + " {:.0%}".format(found_face["distance"])
 
112
  face_result=[face_coordinates,face_confidence]
113
  oneimageannotations.append(face_result)
114
 
@@ -117,15 +118,16 @@ with gr.Blocks() as demo:
117
  )
118
  return results, oneimageannotations
119
 
120
- oneimage_input_image = gr.Image(value="TEST_spindler.jpg")
121
 
122
- found_faces=gr.AnnotatedImage()
123
- debug_output = gr.Textbox()
 
124
  gr.Interface(
125
  allow_flagging = "never",
126
  fn=identify_in_one_image,
127
  inputs=[oneimage_input_image, embedding_backendchoice],
128
- outputs=[found_faces, debug_output]
129
  )
130
 
131
 
 
109
  face_coordinates = (found_face["source_x"],found_face["source_y"], (found_face["source_x"] + found_face["source_w"]),(found_face["source_y"] + found_face["source_h"]))
110
  person = found_face["identity"].split("/")[1].replace("_"," ")
111
  face_confidence = "Matched " + person + " {:.0%}".format(found_face["distance"])
112
+ face_thumbnail = found_face["identity"]
113
  face_result=[face_coordinates,face_confidence]
114
  oneimageannotations.append(face_result)
115
 
 
118
  )
119
  return results, oneimageannotations
120
 
121
+ oneimage_input_image = gr.Image(value="TEST_spindler.jpg", label='Input image')
122
 
123
+ found_faces=gr.AnnotatedImage(label='Identified people')
124
+ debug_output = gr.Textbox(label="Debug output")
125
+ #face_thumbnail = gr.Textbox(label="Identified person")
126
  gr.Interface(
127
  allow_flagging = "never",
128
  fn=identify_in_one_image,
129
  inputs=[oneimage_input_image, embedding_backendchoice],
130
+ outputs=[found_faces,debug_output]
131
  )
132
 
133