Zhu-FaceOnLive commited on
Commit
d08693f
β€’
1 Parent(s): 896ca03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -53,13 +53,13 @@ with gr.Blocks() as demo:
53
  search_face_button = gr.Button("Search Face")
54
  with gr.Column(scale=2):
55
  output = gr.Gallery(label="Found Images", columns=[4], object_fit="contain", height="auto")
 
 
 
56
 
57
- gr.Examples(['examples/1.jpg', 'examples/2.jpg'],
58
- inputs=image, cache_examples="lazy", fn=search_face, outputs=[output])
59
-
60
- search_face_button.click(search_face, inputs=[image], outputs=[output])
61
 
62
  gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2FFaceOnLive%2FFace-Search-Online"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2FFaceOnLive%2FFace-Search-Online&labelColor=%23ff8a65&countColor=%2337d67a&style=flat&labelStyle=upper" /></a>')
63
 
64
 
65
- demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
 
53
  search_face_button = gr.Button("Search Face")
54
  with gr.Column(scale=2):
55
  output = gr.Gallery(label="Found Images", columns=[4], object_fit="contain", height="auto")
56
+ count = gr.Number(label="Count")
57
+
58
+ gr.Examples(['examples/1.jpg', 'examples/2.jpg'], inputs=image, cache_examples=True, cache_mode='lazy', fn=search_face, outputs=[output, count])
59
 
60
+ search_face_button.click(search_face, inputs=image, outputs=[output, count])
 
 
 
61
 
62
  gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2FFaceOnLive%2FFace-Search-Online"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2FFaceOnLive%2FFace-Search-Online&labelColor=%23ff8a65&countColor=%2337d67a&style=flat&labelStyle=upper" /></a>')
63
 
64
 
65
+ demo.queue(api_open=False).launch(server_name="0.0.0.0", server_port=7860, show_api=False)