Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,7 @@ import pathlib
|
|
11 |
from fastai.vision.all import *
|
12 |
from fastai.imports import *
|
13 |
from tensorflow.keras.models import model_from_json
|
|
|
14 |
|
15 |
json_file = open('model.json', 'r')
|
16 |
loaded_model_json = json_file.read()
|
@@ -76,11 +77,11 @@ def who_is_it(image):
|
|
76 |
return ("Not in database")
|
77 |
|
78 |
label = gr.outputs.Label()
|
79 |
-
|
80 |
def recog(image):
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
img = image[y:y+h, x:x+w]
|
85 |
if face is not None:
|
86 |
identity=who_is_it(img)
|
|
|
11 |
from fastai.vision.all import *
|
12 |
from fastai.imports import *
|
13 |
from tensorflow.keras.models import model_from_json
|
14 |
+
from mtcnn.mtcnn import MTCNN
|
15 |
|
16 |
json_file = open('model.json', 'r')
|
17 |
loaded_model_json = json_file.read()
|
|
|
77 |
return ("Not in database")
|
78 |
|
79 |
label = gr.outputs.Label()
|
80 |
+
faceModel=MTCNN()
|
81 |
def recog(image):
|
82 |
+
faces = faceModel.detect_faces(image)
|
83 |
+
for face in faces:
|
84 |
+
x,y,w,h = face["box"]
|
85 |
img = image[y:y+h, x:x+w]
|
86 |
if face is not None:
|
87 |
identity=who_is_it(img)
|