CupidAI / app.py
suinY00N's picture
Update app.py
3addc2b verified
raw
history blame
649 Bytes
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()