File size: 649 Bytes
beacc91
21c549a
 
3addc2b
 
 
 
 
 
21c549a
3addc2b
 
 
 
 
4ccd918
beacc91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from deepface import DeepFace

def face_similarity(img1, img2):
    result = DeepFace.verify(img1, img2)
    similarity = result["distance"]  # ๋‚ฎ์„์ˆ˜๋ก ๋” ์œ ์‚ฌ
    verified = result["verified"]
    
    return f"์œ ์‚ฌ๋„: {similarity}, ์ธ์ฆ ๊ฒฐ๊ณผ: {verified}"

iface = gr.Interface(fn=face_similarity, 
                     inputs=[gr.inputs.Image(shape=(224, 224)), gr.inputs.Image(shape=(224, 224))], 
                     outputs="text",
                     title="์–ผ๊ตด ์œ ์‚ฌ๋„ ์ธก์ •",
                     description="๋‘ ์–ผ๊ตด ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•ด์„œ ์œ ์‚ฌ๋„๋ฅผ ์ธก์ •ํ•ฉ๋‹ˆ๋‹ค.")

iface.launch()