Skip to content

Draw

Processors for drawing

[source]

DrawBoxes2D

paz.processors.draw.DrawBoxes2D(class_names=None, colors=None, weighted=False, scale=0.7, with_score=True)

Draws bounding boxes from Boxes2D messages.

Arguments

  • class_names: List of strings.
  • colors: List of lists containing the color values
  • weighted: Boolean. If True the colors are weighted with the score of the bounding box.
  • scale: Float. Scale of drawn text.

[source]

DrawKeypoints2D

paz.processors.draw.DrawKeypoints2D(num_keypoints, radius=3, normalized=False)

Draws keypoints into image.

Arguments

  • num_keypoints: Int. Used initialize colors for each keypoint
  • radius: Float. Approximate radius of the circle in pixel coordinates.

[source]

DrawBoxes3D

paz.processors.draw.DrawBoxes3D(camera, class_to_dimensions, color=(0, 255, 0), thickness=5, radius=2)

[source]

DrawRandomPolygon

paz.processors.draw.DrawRandomPolygon(max_radius_scale=0.5)

Adds occlusion to image

Arguments

  • max_radius_scale: Maximum radius in scale with respect to image i.e. each vertex radius from the polygon is sampled from [0, max_radius_scale]. This radius is later multiplied by the image dimensions.

[source]

DrawPose6D

paz.processors.draw.DrawPose6D(object_sizes, camera_intrinsics, thickness=2)

Draws a single cube in image by projecting points3D.

Arguments

  • object_sizes: Array (3) indicating (x, y, z) sizes of object.
  • camera_intrinsics: Array (3, 3). Camera intrinsics for projecting 3D rays into 2D image.
  • thickness: Positive integer indicating line thickness.

Returns

Image array (H, W) with drawn inferences.


[source]

DrawPoses6D

paz.processors.draw.DrawPoses6D(object_sizes, camera_intrinsics, thickness=2)

Draws multiple cubes in image by projecting points3D.

Arguments

  • object_sizes: Array (3) indicating (x, y, z) sizes of object.
  • camera_intrinsics: Array (3, 3). Camera intrinsics for projecting 3D rays into 2D image.
  • thickness: Positive integer indicating line thickness.

Returns

Image array (H, W) with drawn inferences.


[source]

DrawHumanSkeleton

paz.processors.draw.DrawHumanSkeleton(dataset, check_scores, link_width=2, keypoint_radius=4)

Draw human pose skeleton on image.

Arguments

  • images: Numpy array.
  • grouped_joints: Joint locations of all the person model detected in the image. List of numpy array.
  • dataset: String.
  • check_scores: Boolean. Flag to check score before drawing.

Returns

A numpy array containing pose skeleton.


[source]

DrawHandSkeleton

paz.processors.draw.DrawHandSkeleton(check_scores=False, link_width=2, keypoint_radius=4)

Draw hand pose skeleton on image.

Arguments

  • image: Array (H, W, 3)
  • keypoints: Array. All the joint locations detected by model in the image. Returns

A numpy array containing pose skeleton.


[source]

DrawRGBMask

paz.processors.draw.DrawRGBMask(object_sizes)

Draws RGB mask by transforming points3D to RGB space and putting in them in their 2D coordinates (points2D)

Arguments

  • object_sizes: Array (x_size, y_size, z_size)

[source]

DrawRGBMasks

paz.processors.draw.DrawRGBMasks(object_sizes)

Draws RGB masks by transforming points3D to RGB space and putting in them in their 2D coordinates (points2D)

Arguments

  • object_sizes: Array (x_size, y_size, z_size)

[source]

DrawText

paz.processors.draw.DrawText(color=(0, 255, 0), thickness=2, scale=1)

Draws text to image.

Arguments

  • color: List. Color of text to
  • thickness: Int. Thickness of text.
  • scale: Int. Size scale for text.
  • message: Str. Text to be added on the image.
  • location: List/tuple of int. Pixel corordinte in image to add text.

[source]

DrawHumanPose6D

paz.processors.draw.DrawHumanPose6D(camera_intrinsics)

Draw basis vectors for human pose 6D

Arguments

  • image: numpy array
  • rotation: numpy array of size (3 x 3)
  • translations: list of length 3

Returns

  • image: numpy array