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