suinY00N commited on
Commit
e8dfdf0
โ€ข
1 Parent(s): 63e4913

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -17
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