Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,7 @@ for f in os.listdir("data"):
|
|
49 |
import tempfile
|
50 |
import faceSym
|
51 |
from PIL import Image
|
|
|
52 |
|
53 |
def left_right_sim(img):
|
54 |
tmpf = tempfile.NamedTemporaryFile(delete=False)
|
@@ -81,8 +82,8 @@ def greet(image_to_test):
|
|
81 |
img = face_recognition.load_image_file(os.path.join("data", filepath))
|
82 |
ret += "\n\n \
|
83 |
The similarity (symmetry score) of \
|
84 |
-
left and right face = {:.3}".format(
|
85 |
-
left_right_sim(image_to_test))
|
86 |
return img, ret
|
87 |
|
88 |
iface = gr.Interface(fn=greet, inputs=gr.Image(source="webcam", streaming=True, type="numpy"), outputs=["image", "text"])
|
|
|
49 |
import tempfile
|
50 |
import faceSym
|
51 |
from PIL import Image
|
52 |
+
import numpy as np
|
53 |
|
54 |
def left_right_sim(img):
|
55 |
tmpf = tempfile.NamedTemporaryFile(delete=False)
|
|
|
82 |
img = face_recognition.load_image_file(os.path.join("data", filepath))
|
83 |
ret += "\n\n \
|
84 |
The similarity (symmetry score) of \
|
85 |
+
left and right face = {:.3}%".format(
|
86 |
+
left_right_sim(image_to_test).item())
|
87 |
return img, ret
|
88 |
|
89 |
iface = gr.Interface(fn=greet, inputs=gr.Image(source="webcam", streaming=True, type="numpy"), outputs=["image", "text"])
|