File size: 1,571 Bytes
6a8a06c
c783314
6a8a06c
 
 
 
c783314
6a8a06c
 
76ffeab
6a8a06c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c783314
6a8a06c
 
 
76ffeab
c783314
6a8a06c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import gradio as gr
import requests
import base64
from io import BytesIO
from PIL import Image

def search_face(image):
    return image, 1

with gr.Blocks() as demo:
    gr.Markdown(
        """
    # Search Your Face Online For Free
    ## For more detailed information, please check on our website.<br/>
    ## [FaceOnLive: On-premises ID Verification, Biometric Authentication Solution Provider](https://faceonlive.com)    
    <br>
    
    ## For premium support or partnership inquiries, contact us.
    """
    )
    with gr.Row():
        with gr.Column(scale=1):
            image = gr.Image(type='filepath', height=480)
            search_face_button = gr.Button("Search Face")
        with gr.Column(scale=2):
            output = gr.Gallery(label="Found Images", columns=[4], object_fit="contain", height="auto")
            countwg = gr.Number(label="Count")
    
    gr.Examples(['examples/1.jpg', 'examples/2.jpg'], inputs=image, cache_examples=True, cache_mode='lazy', fn=search_face, outputs=[output, countwg])

    search_face_button.click(search_face, inputs=image, outputs=[output, countwg], api_name=False)

    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>')


demo.queue(api_open=False).launch(server_name="0.0.0.0", server_port=7860, show_api=False)