PicoDetector¶
-
class
menpodetect.pico.
PicoDetector
(model, detector=<class 'menpodetect.pico.detect._pico_detect'>)[source]¶ Bases:
object
A generic pico detector.
Wraps a pico object detector inside the menpodetect framework and provides a clean interface to expose the pico arguments.
At the moment this isn’t particularly useful as loading Pico models is complex.
-
__call__
(image, image_diagonal=None, group_prefix='pico', max_detections=100, orientations=0.0, degrees=True, scale_factor=1.2, stride_factor=0.1, min_size=100, confidence_cutoff=3.0, axis_aligned_bb=True)[source]¶ Perform a detection using the cached pico detector.
The detections will also be attached to the image as landmarks.
Parameters: - image (menpo.image.Image) – A Menpo image to detect. The bounding boxes of the detected objects will be attached to this image.
- 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.
- max_detections (int, optional) – The maximum number of detections to return.
- orientations (list of float`s or `float, optional) – The orientations of the cascades to use.
0.0
will perform an axis aligned detection. Values greater than0.0
will perform detections of the cascade rotated counterclockwise around a unit circle. If a list is passed, each item should be an orientation in either radians or degrees around the unit circle, with0.0
being axis aligned. - degrees (bool, optional) – If
True
, theorientations
parameter is treated as rotations counterclockwise in degrees rather than radians. - scale_factor (float, optional) – The ratio to increase the cascade window at every iteration. Must be greater than 1.0
- stride_factor (float, optional) – The ratio to decrease the window step by at every iteration. Must be less than 1.0, optional
- min_size (float, optional) – The minimum size in pixels (diameter of the detection circle) that a face can be. This is the starting cascade window size.
- confidence_cutoff (float, optional) – The confidence value to trim the detections with. Any detections with confidence less than the cutoff will be discarded.
- axis_aligned_bb (bool, optional) – If
True
, the returned detections will be axis aligned, regardless of which orientation they were detected at. IfFalse
, the returned bounding box will be rotated by the orientation detected.
Returns: bounding_boxes (menpo.shape.PointDirectedGraph) – The detected objects.
-