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