def _detect(self, im, opts):
    '\n        In RankOne, face detection happends within the roc_represent function.\n        There is no explicit face detection step like in dlib. \n        But we will output the bounding box. but it is not really useful in this case.   \n        '
    '\n        Rank one requires the image to be of type roc_image. Hence\n        we will check for the image type. In this case it is a numpy array (skimage imread). \n        Check if the image is a numpy array and if it is then conver it to a PIL image and \n        then to a roc_image. The reason I am doing this is cause rankone provides example code \n        to convert from PIL image to  roc_image.\n        '
    (h, w, _) = im.shape
    if isinstance(im, np.ndarray):
        im = self._converttoRocImage(im)
    '\n        indicates the smalled face to detect\n        Face detection size is measured by the width of the face in pixels. \n        The default value is 36. It roughly correspinds to 18 pixels between the eyes.\n        '
    if (self.min_face_size == 'recommended'):
        self.min_face_size = self.recommendedMinFaceSize()
    elif (self.min_face_size == 'adaptive_size'):
        '\n            A method for determining the minimum face detection size as a fraction of the image size.\n\n            In the interest of efficiency, it is recommended to set a lower bound on the minimum face detection size as a fraction of the image size. Given a relative minimum size of 4% of the image dimensions, and an absolute minimum size of 36 pixels, the adaptive minimum size is: max(max(image.width, image.height) * 0.04, 36).\n\n            Example\n            roc_image image = ...;\n            size_t adaptive_minimum_size;\n            roc_adaptive_minimum_size(image, 0.04, 36, &adaptive_minimum_size);\n        '
        adaptive_minimum_size = new_size_t()
        roc_ensure(roc_adaptive_minimum_size(im, 0.04, 36, adaptive_minimum_size))
    else:
        self.min_face_size = int(self.min_face_size)
    self.detection_threshold = opts.threshold
    if opts.best:
        self.num_faces = 1
    templates = roc.new_roc_template_array(self.num_faces)
    if (self.min_face_size != 'adaptive_size'):
        roc.roc_represent(im, self.algorithm_id_detect, self.min_face_size, self.num_faces, self.detection_threshold, self.img_quality, templates)
    else:
        roc.roc_represent(im, self.algorithm_id_detect, size_t_value(adaptive_minimum_size), self.num_faces, detection_threshold, self.img_quality, templates)
        roc.delete_size_t(adaptive_minimum_size)
    curr_template = roc.roc_template_array_getitem(templates, 0)
    if ((curr_template.algorithm_id == 0) or (curr_template.algorithm_id & roc.ROC_INVALID)):
        curr_template = roc.roc_template_array_getitem(templates, 0)
        curr_template.detection.x = int((w * 0.5))
        curr_template.detection.y = int((h * 0.5))
        curr_template.detection.width = w
        curr_template.detection.height = h
        roc.roc_template_array_setitem(templates, 0, curr_template)
        roc.roc_represent(im, roc.ROC_MANUAL, self.min_face_size, 1, self.detection_threshold, self.img_quality, templates)
    roc.roc_free_image(im)
    return templates
In RankOne, face detection happends within the roc_represent function.
There is no explicit face detection step like in dlib. 
But we will output the bounding box. but it is not really useful in this case.
def _detect(self, im, opts):
    '\n        In RankOne, face detection happends within the roc_represent function.\n        There is no explicit face detection step like in dlib. \n        But we will output the bounding box. but it is not really useful in this case.   \n        '
    '\n        Rank one requires the image to be of type roc_image. Hence\n        we will check for the image type. In this case it is a numpy array (skimage imread). \n        Check if the image is a numpy array and if it is then conver it to a PIL image and \n        then to a roc_image. The reason I am doing this is cause rankone provides example code \n        to convert from PIL image to  roc_image.\n        '
    (h, w, _) = im.shape
    if isinstance(im, np.ndarray):
        im = self._converttoRocImage(im)
    '\n        indicates the smalled face to detect\n        Face detection size is measured by the width of the face in pixels. \n        The default value is 36. It roughly correspinds to 18 pixels between the eyes.\n        '
    if (self.min_face_size == 'recommended'):
        self.min_face_size = self.recommendedMinFaceSize()
    elif (self.min_face_size == 'adaptive_size'):
        '\n            A method for determining the minimum face detection size as a fraction of the image size.\n\n            In the interest of efficiency, it is recommended to set a lower bound on the minimum face detection size as a fraction of the image size. Given a relative minimum size of 4% of the image dimensions, and an absolute minimum size of 36 pixels, the adaptive minimum size is: max(max(image.width, image.height) * 0.04, 36).\n\n            Example\n            roc_image image = ...;\n            size_t adaptive_minimum_size;\n            roc_adaptive_minimum_size(image, 0.04, 36, &adaptive_minimum_size);\n        '
        adaptive_minimum_size = new_size_t()
        roc_ensure(roc_adaptive_minimum_size(im, 0.04, 36, adaptive_minimum_size))
    else:
        self.min_face_size = int(self.min_face_size)
    self.detection_threshold = opts.threshold
    if opts.best:
        self.num_faces = 1
    templates = roc.new_roc_template_array(self.num_faces)
    if (self.min_face_size != 'adaptive_size'):
        roc.roc_represent(im, self.algorithm_id_detect, self.min_face_size, self.num_faces, self.detection_threshold, self.img_quality, templates)
    else:
        roc.roc_represent(im, self.algorithm_id_detect, size_t_value(adaptive_minimum_size), self.num_faces, detection_threshold, self.img_quality, templates)
        roc.delete_size_t(adaptive_minimum_size)
    curr_template = roc.roc_template_array_getitem(templates, 0)
    if ((curr_template.algorithm_id == 0) or (curr_template.algorithm_id & roc.ROC_INVALID)):
        curr_template = roc.roc_template_array_getitem(templates, 0)
        curr_template.detection.x = int((w * 0.5))
        curr_template.detection.y = int((h * 0.5))
        curr_template.detection.width = w
        curr_template.detection.height = h
        roc.roc_template_array_setitem(templates, 0, curr_template)
        roc.roc_represent(im, roc.ROC_MANUAL, self.min_face_size, 1, self.detection_threshold, self.img_quality, templates)
    roc.roc_free_image(im)
    return templates