Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# import gradio as gr
|
2 |
# from deepface import DeepFace
|
3 |
# import pandas as pd
|
@@ -45,20 +63,3 @@
|
|
45 |
# iface.launch()
|
46 |
|
47 |
|
48 |
-
import gradio as gr
|
49 |
-
from deepface import DeepFace
|
50 |
-
|
51 |
-
def face_similarity(img1, img2):
|
52 |
-
result = DeepFace.verify(img1, img2)
|
53 |
-
similarity = result["distance"] # ๋ฎ์์๋ก ๋ ์ ์ฌ
|
54 |
-
verified = result["verified"]
|
55 |
-
|
56 |
-
return f"์ ์ฌ๋: {similarity}, ์ธ์ฆ ๊ฒฐ๊ณผ: {verified}"
|
57 |
-
|
58 |
-
iface = gr.Interface(fn=face_similarity,
|
59 |
-
inputs=[gr.inputs.Image(shape=(224, 224)), gr.inputs.Image(shape=(224, 224))],
|
60 |
-
outputs="text",
|
61 |
-
title="์ผ๊ตด ์ ์ฌ๋ ์ธก์ ",
|
62 |
-
description="๋ ์ผ๊ตด ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํด์ ์ ์ฌ๋๋ฅผ ์ธก์ ํฉ๋๋ค.")
|
63 |
-
|
64 |
-
iface.launch()
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from deepface import DeepFace
|
3 |
+
|
4 |
+
def face_similarity(img1, img2):
|
5 |
+
result = DeepFace.verify(img1, img2)
|
6 |
+
similarity = result["distance"] # ๋ฎ์์๋ก ๋ ์ ์ฌ
|
7 |
+
verified = result["verified"]
|
8 |
+
|
9 |
+
return f"์ ์ฌ๋: {similarity}, ์ธ์ฆ ๊ฒฐ๊ณผ: {verified}"
|
10 |
+
|
11 |
+
iface = gr.Interface(fn=face_similarity,
|
12 |
+
inputs=[gr.inputs.Image(shape=(224, 224)), gr.inputs.Image(shape=(224, 224))],
|
13 |
+
outputs="text",
|
14 |
+
title="์ผ๊ตด ์ ์ฌ๋ ์ธก์ ",
|
15 |
+
description="๋ ์ผ๊ตด ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํด์ ์ ์ฌ๋๋ฅผ ์ธก์ ํฉ๋๋ค.")
|
16 |
+
|
17 |
+
iface.launch()
|
18 |
+
|
19 |
# import gradio as gr
|
20 |
# from deepface import DeepFace
|
21 |
# import pandas as pd
|
|
|
63 |
# iface.launch()
|
64 |
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|