Module Import alias Import alias identifier ImportFrom alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad NameLoad If Call NameLoad NameLoad NameLoad body Return BinOpMult ListLoad NameLoad NameLoad orelse If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad GeneratorExp Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad If BoolOpAnd CompareEq NameLoad Num NameLoad body Return BinOpMult Call NameLoad NameLoad NameLoad orelse If BoolOpAnd CompareEq NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad orelse Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str Num NameLoad Str Num Str Str Num body Import alias identifier Assign NameStore BinOpDiv SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Slice Num Num Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr keyword Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr BinOpAdd SubscriptLoad NameLoad Slice Num TupleLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Ellipsis Slice Num decorator_list FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad NameLoad body ImportFrom alias Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body If Call NameLoad GeneratorExp CompareLtE NameLoad Num comprehension NameStore NameLoad body Assign NameStore ListComp Call NameLoad BinOpMult NameLoad Num comprehension NameStore NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str Num NameLoad Str Num Str Str Num body ImportFrom alias If Call NameLoad GeneratorExp CompareNotEq NameLoad Str comprehension NameStore NameLoad body Raise Call NameLoad Str If Call NameLoad GeneratorExp CompareNotIn NameLoad Set Str Str comprehension NameStore NameLoad body Raise Call NameLoad Str If Call NameLoad GeneratorExp CompareGt NameLoad Num comprehension NameStore NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad If Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd SubscriptLoad NameLoad Index NameLoad CompareGt SubscriptLoad NameLoad Index NameLoad Num Call NameLoad NameLoad Str CompareGt AttributeLoad AttributeLoad NameLoad attr attr Num body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad NameLoad ExtSlice Index SubscriptLoad NameLoad ExtSlice Slice Index Num Slice SubscriptLoad NameLoad ExtSlice Index SubscriptLoad NameLoad ExtSlice Slice Index Num Slice For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Call NameLoad SubscriptLoad NameLoad Slice Num Call NameLoad SubscriptLoad NameLoad Slice Num keyword SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad If BoolOpAnd SubscriptLoad NameLoad Index NameLoad CompareGt SubscriptLoad NameLoad Index NameLoad Num body Assign NameStore IfExp CompareEq SubscriptLoad NameLoad Index NameLoad Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore IfExp CompareEq SubscriptLoad NameLoad Index NameLoad Num SubscriptLoad NameLoad Index NameLoad NameLoad For NameStore NameLoad body Assign TupleStore NameStore NameStore NameLoad Expr Call NameLoad TupleLoad BinOpSub NameLoad SubscriptLoad NameLoad Index NameLoad BinOpSub NameLoad SubscriptLoad NameLoad Index NameLoad BinOpAdd NameLoad SubscriptLoad NameLoad Index NameLoad BinOpAdd NameLoad SubscriptLoad NameLoad Index NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword NameLoad Delete NameDel Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq AttributeLoad NameLoad attr Num body Return Call AttributeLoad NameLoad attr NameLoad orelse Return Call NameLoad NameLoad decorator_list Assign NameStore Dict Str Str NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Str Str Num NameLoad Str Num Str Str Num Str body Expr Str If BoolOpAnd CompareNotEq AttributeLoad NameLoad attr Num CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareIn NameLoad NameLoad body If Call NameLoad NameLoad NameLoad body Assign NameStore ListComp AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr comprehension NameStore NameLoad orelse Assign NameStore ListLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad TupleLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad TupleLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad TupleLoad NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str NameLoad Return Call SubscriptLoad NameLoad Index NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Raise Call NameLoad Call AttributeLoad Str attr NameLoad decorator_list
N/A N/A collections N/A numpy np menpo.shape bounding_box TriMesh menpo.image Image menpo.compatibility basestring check_param N/A N/A n types param_name param N/A N/A N/A 
    Utility method for validating a given parameter. Since parameters may be
    a single option applied to all items in the list, or a list of different
    options per item, we validate this. If a single argument is passed, it
    is extended into a list.

    Parameters
    ----------
    n : `int`
        Number of items expected.
    types : `type`
        Python `type` or list of `types` that the parameters are expected to be.
    param_name : `str`
        The name of parameter for printing error messages.
    param : `object`
        An object or list of objects that represent a parameter for a
        function.

    Returns
    -------
    param_list : `list` of type `object`
        This is a validated list of length ``n``, one parameter for each
        element in the implicit list of other parameters.
     N/A error_msg N/A N/A {0} must be a {1} or a list/tuple of {1} with length {2} format param_name types n N/A N/A isinstance param types N/A N/A N/A N/A param n N/A N/A N/A N/A isinstance param N/A collections Iterable N/A N/A N/A ValueError error_msg N/A len_param N/A len param N/A isinstance_all_in_param N/A all N/A N/A isinstance p types N/A p param N/A N/A N/A len_param 1 isinstance_all_in_param N/A N/A N/A N/A list param n N/A N/A N/A N/A len_param n isinstance_all_in_param N/A N/A N/A list param N/A N/A N/A ValueError error_msg N/A _rasterize_matplotlib N/A N/A image pclouds render_lines line_style line_colour line_width render_markers marker_style marker_size marker_face_colour marker_edge_colour marker_edge_width N/A True - b 1 True o 1 b b 1 N/A N/A matplotlib.pyplot plt N/A image_shape N/A N/A N/A N/A np array N/A image shape N/A -1 100.0 N/A f N/A N/A plt figure figsize image_shape frameon False dpi 100 N/A N/A N/A image view figure_id N/A f number figure_size image_shape N/A N/A k p N/A enumerate pclouds N/A N/A N/A N/A p view figure_id N/A f number render_axes False figure_size image_shape render_lines N/A render_lines N/A k line_style N/A line_style N/A k line_colour N/A line_colour N/A k line_width N/A line_width N/A k render_markers N/A render_markers N/A k marker_style N/A marker_style N/A k marker_size N/A marker_size N/A k marker_face_colour N/A marker_face_colour N/A k marker_edge_colour N/A marker_edge_colour N/A k marker_edge_width N/A marker_edge_width N/A k N/A N/A N/A f tight_layout pad 0 N/A N/A c_buffer shape N/A N/A N/A f canvas print_to_buffer N/A pixels_buffer N/A N/A N/A N/A np array c_buffer reshape N/A N/A shape N/A -1 N/A -1 N/A N/A N/A plt close f N/A N/A N/A Image init_from_rolled_channels N/A pixels_buffer N/A N/A N/A 3 N/A _parse_colour N/A N/A x N/A N/A N/A N/A isinstance x basestring N/A matplotlib.colors ColorConverter N/A c N/A ColorConverter N/A x N/A N/A c to_rgb x N/A N/A isinstance x N/A tuple list N/A N/A N/A any N/A N/A a 1.0 N/A a x N/A N/A x N/A N/A int N/A a 255 N/A a x N/A N/A tuple x N/A _rasterize_pillow N/A N/A image pclouds render_lines line_style line_colour line_width render_markers marker_style marker_size marker_face_colour marker_edge_colour marker_edge_width N/A True - b 1 True o 1 b b 1 N/A PIL ImageDraw N/A N/A any N/A N/A x - N/A x line_style N/A N/A N/A ValueError The Pillow rasterizer only supports the '-' line style. N/A N/A any N/A N/A x N/A o s N/A x marker_style N/A N/A N/A ValueError The Pillow rasterizer only supports the 'o' and 's' marker styles. N/A N/A any N/A N/A x 1 N/A x marker_edge_width N/A N/A N/A ValueError The Pillow rasterizer only supports marker_edge_width of 1 or 0. N/A pil_im N/A N/A image as_PILImage N/A draw N/A N/A ImageDraw Draw pil_im N/A line_colour N/A N/A _parse_colour x N/A x line_colour N/A marker_edge_colour N/A N/A _parse_colour x N/A x marker_edge_colour N/A marker_face_colour N/A N/A _parse_colour x N/A x marker_face_colour N/A k N/A range N/A len pclouds N/A N/A p N/A pclouds N/A k N/A N/A isinstance p TriMesh N/A N/A N/A pclouds N/A k N/A N/A p as_pointgraph N/A points N/A p points N/A N/A N/A render_lines N/A k N/A N/A line_width N/A k 0 N/A hasattr p edges N/A N/A N/A p edges size 0 N/A N/A edges N/A p edges N/A lines N/A zip N/A points N/A N/A N/A edges N/A N/A N/A 0 N/A N/A points N/A N/A N/A edges N/A N/A N/A 1 N/A N/A N/A l1 l2 lines N/A N/A N/A N/A draw line N/A N/A tuple N/A l1 N/A -1 N/A tuple N/A l2 N/A -1 fill N/A line_colour N/A k width N/A line_width N/A k N/A N/A N/A render_markers N/A k N/A N/A marker_size N/A k 0 N/A N/A draw_func N/A N/A N/A marker_style N/A k o N/A draw ellipse N/A draw rectangle N/A outline N/A N/A N/A marker_edge_width N/A k 1 N/A marker_edge_colour N/A k None N/A p points N/A N/A N/A y x p N/A N/A draw_func N/A N/A x N/A marker_size N/A k N/A y N/A marker_size N/A k N/A x N/A marker_size N/A k N/A y N/A marker_size N/A k fill N/A marker_face_colour N/A k outline outline N/A draw N/A pixels N/A N/A np asarray pil_im N/A N/A N/A image n_channels 3 N/A N/A N/A N/A Image init_from_rolled_channels pixels N/A N/A N/A Image pixels N/A N/A _RASTERIZE_BACKENDS N/A matplotlib pillow _rasterize_matplotlib _rasterize_pillow rasterize_landmarks_2d N/A N/A image group render_lines line_style line_colour line_width render_markers marker_style marker_size marker_face_colour marker_edge_colour marker_edge_width backend N/A None True - b 1 True o 1 b b 1 matplotlib N/A N/A 
    This method provides the ability to rasterize 2D landmarks onto an image.
    The returned image has the specified landmark groups rasterized onto
    the image - which is useful for things like creating result examples
    or rendering videos with annotations.

    Since multiple landmark groups can be specified, all arguments can
    take lists of parameters that map to the provided groups list. Therefore,
    the parameters must be lists of the correct length or a single parameter
    to apply to every landmark group.

    Multiple backends are provided, all with different strengths. The 'pillow'
    backend is very fast, but not very flexible. The `matplotlib` backend
    should be feature compatible with other Menpo rendering methods, but
    is much slower due to the overhead of creating a figure to render
    into.

    Parameters
    ----------
    image : :map:`Image` or subclass
        The image to render onto.
    group : `str` or `list` of `str`, optional
        The landmark group key, or a list of keys.
    render_lines : `bool`, optional
        If ``True``, and the provided landmark group is a :map:`PointGraph`,
        the edges are rendered.
    line_style : `str`, optional
        The style of the edge line. Not all backends support this argument.
    line_colour : `str` or `tuple`, optional
        A Matplotlib style colour or a backend dependant colour.
    line_width : `int`, optional
        The width of the line to rasterize.
    render_markers : `bool`, optional
        If ``True``, render markers at the coordinates of each landmark.
    marker_style : `str`, optional
        A Matplotlib marker style. Not all backends support all marker styles.
    marker_size : `int`, optional
        The size of the marker - different backends use different scale
        spaces so consistent output may by difficult.
    marker_face_colour : `str`, optional
        A Matplotlib style colour or a backend dependant colour.
    marker_edge_colour : `str`, optional
        A Matplotlib style colour or a backend dependant colour.
    marker_edge_width : `int`, optional
        The width of the marker edge. Not all backends support this.
    backend : {'matplotlib', 'pillow'}, optional
        The backend to use.

    Returns
    -------
    rasterized_image : :map:`Image`
        The image with the landmarks rasterized directly into the pixels.

    Raises
    ------
    ValueError
        Only 2D images are supported.
    ValueError
        Only RGB (3-channel) or Greyscale (1-channel) images are supported.
     N/A N/A N/A N/A image n_channels 1 N/A N/A image n_channels 3 N/A N/A N/A ValueError Only RGB or Greyscale images can be rasterized N/A N/A N/A image n_dims 2 N/A N/A N/A ValueError Only 2D images can be rasterized. N/A N/A backend _RASTERIZE_BACKENDS N/A N/A N/A isinstance group list N/A N/A landmarks N/A N/A N/A N/A image landmarks N/A g lms N/A g group N/A N/A landmarks N/A N/A N/A N/A image landmarks N/A group lms N/A n_pclouds N/A len landmarks N/A render_lines N/A check_param n_pclouds bool render_lines render_lines N/A line_style N/A check_param n_pclouds basestring line_style line_style N/A line_colour N/A check_param n_pclouds N/A basestring tuple line_colour line_colour N/A line_width N/A check_param n_pclouds int line_width line_width N/A render_markers N/A check_param n_pclouds bool render_markers render_markers N/A marker_style N/A check_param n_pclouds basestring marker_style marker_style N/A marker_size N/A check_param n_pclouds int marker_size marker_size N/A marker_face_colour N/A check_param n_pclouds N/A basestring tuple marker_face_colour marker_face_colour N/A marker_edge_colour N/A check_param n_pclouds N/A basestring tuple marker_edge_colour marker_edge_colour N/A marker_edge_width N/A check_param n_pclouds int marker_edge_width marker_edge_width N/A N/A N/A _RASTERIZE_BACKENDS N/A backend image landmarks render_lines render_lines line_style line_style line_colour line_colour line_width line_width render_markers render_markers marker_style marker_style marker_size marker_size marker_face_colour marker_face_colour marker_edge_colour marker_edge_colour marker_edge_width marker_edge_width N/A N/A N/A ValueError N/A N/A Unsupported backend: {} format backend N/A