Spaces:
Running
Running
debugging code in prod
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import json
|
|
|
3 |
|
4 |
os.environ["DEEPFACE_HOME"] = "."
|
5 |
|
@@ -25,17 +26,15 @@ with pyzipper.AESZipFile('persons.zip') as zf:
|
|
25 |
zf.setpassword(b"4321ecafhsats"[::-1])
|
26 |
PERFORMER_DB = json.loads(zf.read('performers.json'))
|
27 |
|
28 |
-
from hashlib import sha1
|
29 |
|
30 |
def predict(image, threshold=20.0, results=3):
|
31 |
image_array = np.array(image)
|
32 |
-
# print(image_array)
|
33 |
print(sha1(image_array).hexdigest())
|
34 |
|
35 |
img = functions.preprocess_face(
|
36 |
img=image_array,
|
37 |
target_size=(input_shape_x, input_shape_y),
|
38 |
-
enforce_detection=
|
39 |
detector_backend="retinaface",
|
40 |
align=True,
|
41 |
)
|
|
|
1 |
import os
|
2 |
import json
|
3 |
+
from hashlib import sha1
|
4 |
|
5 |
os.environ["DEEPFACE_HOME"] = "."
|
6 |
|
|
|
26 |
zf.setpassword(b"4321ecafhsats"[::-1])
|
27 |
PERFORMER_DB = json.loads(zf.read('performers.json'))
|
28 |
|
|
|
29 |
|
30 |
def predict(image, threshold=20.0, results=3):
|
31 |
image_array = np.array(image)
|
|
|
32 |
print(sha1(image_array).hexdigest())
|
33 |
|
34 |
img = functions.preprocess_face(
|
35 |
img=image_array,
|
36 |
target_size=(input_shape_x, input_shape_y),
|
37 |
+
enforce_detection=True,
|
38 |
detector_backend="retinaface",
|
39 |
align=True,
|
40 |
)
|