forked from pommes-frites/piwigo-facetag
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdeep.py
More file actions
27 lines (18 loc) · 656 Bytes
/
Copy pathdeep.py
File metadata and controls
27 lines (18 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from deepface import DeepFace
from PIL import Image
import numpy as np
import pandas as pd
pd.set_option('display.max_colwidth', -1)
db_path = "/home/collin/Web/piwigo/plugins/MugShot/training"
target_img = "/home/collin/Downloads/IMG_8069.jpg"
backends = ['opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface']
#face detection and alignment
detected_face = DeepFace.detectFace(target_img, detector_backend = backends[4])
#face recognition
#df = DeepFace.find(target_img, db_path, detector_backend = backends[4])
#Convert array to image
images = Image.fromarray(detected_face)
# Display image
for image in images:
image.show()
print(detected_face)