Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def fac_detection_alignment(img, minsize, PNet, RNet, ONet, threshold, factor):
'''
return all the aligned faces with the given image
'''
# face detection
boundingboxes, points = mtcnn.detect_face(img, minsize, PNet, RNet, ONet, threshold, False, factor)
if(boundingboxes.shape[0] == 0):
alignfaces = []
else:
# face alignment
alignfaces = faceAlign(img, points)
# original image with facial rects
img = mtcnn.drawBoxes(img, boundingboxes)
return alignfaces, img