menpodetect.detect.detect(detector_callable, image, greyscale=True, image_diagonal=None, group_prefix='object', channels_at_back=True)[source]

Apply the general detection framework.

This involves converting the image to greyscale if necessary, rescaling the image to a given diagonal, performing the detection, and attaching the scaled landmarks back onto the original image.

uint8 images cannot be converted to greyscale by this framework, so must already be greyscale or greyscale=False.

  • detector_callable (callable or function) – A callable object that will perform detection given a single parameter, a uint8 numpy array with either no channels, or channels as the last axis.
  • image (menpo.image.Image) – A Menpo image to detect. The bounding boxes of the detected objects will be attached to this image.
  • greyscale (bool, optional) – Convert the image to greyscale or not.
  • image_diagonal (int, optional) – The total size of the diagonal of the image that should be used for detection. This is useful for scaling images up and down for detection.
  • group_prefix (str, optional) – The prefix string to be appended to each each landmark group that is stored on the image. Each detection will be stored as group_prefix_# where # is a count starting from 0.
  • channels_at_back (bool, optional) – If True, the image channels are placed onto the last axis (the back) as is common in many imaging packages. This is contrary to the Menpo default where channels are the first axis (at the front).

bounding_boxes (list of menpo.shape.PointDirectedGraph) – A list of bounding boxes representing the detections found.