How to use the mtcnn.drawBoxes function in mtcnn

To help you get started, we’ve selected a few mtcnn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wujiyang / BossRecognition / detectionAndAlign.py View on Github external
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