- clone this repo and use like:
from wutong_face import WutongFace
wface = WutongFace()
image_file = "F:\\images\\000002.jpg"
### faces_no_align is a list of PIL.Image
faces_no_align = wface.face_no_align(image_file,crop_size=(180,180),min_face_size=20)
#faces_align = wface.face_align(image_file,crop_size=(180,180),min_face_size=20)
faces_no_align[0].show()
- you can also use the base detector api like:
from wutong_face import WutongFace
image_file = "F:\\images\\000002.jpg"
##init a WutongFace
wface = WutongFace()
# 1. using the detector
image = Image.open(image_file)
face_num,bounding_boxes,landmarks = wface.detect(image)
- the perfomance
-
for face feature extract you should download the pretrained model file to the feature_extractor/pretrained_model path: sphereface-onedrive
cosface-onedrive
insightface-onedrive
VGGFace2-resnet-onedrive# 2. use detector and extract feature faces_align,_,_ = wface.face_align(image_file,crop_size=(150,150)) print(len(faces_align)) if len(faces_align) <= 0: print("no faces") feature = wface.feature_extractor('resnet',faces_align) print(feature.shape)
mtcnn-pytorch
sphereface_pytorch
CosFace_pytorch
InsightFace_Pytorch
VGGFace2-pytorch