pose_format package

Here’s a breakdown of the main subpackages:

Subpackages:

Submodules

pose_format.pose module

Classes:

Pose(header, body)

File IO for '.pose' file format, including the header and body.

class pose_format.pose.Pose(header, body)[source]

Bases: object

File IO for ‘.pose’ file format, including the header and body.

Parameters:
  • header (PoseHeader) – Header information for the pose.

  • body (PoseBody) – Body data for the pose.

Methods:

bbox()

Calculates bounding box for Pose.

focus()

Gets the pose to start at (0,0) and have dimensions as big as needed

frame_dropout_normal([dropout_mean, dropout_std])

Normal frame dropout on Pose.

frame_dropout_uniform([dropout_min, dropout_max])

Perform uniform frame dropout on Pose

get_components(components[, points])

get pose components based on criteria.

normalize(info[, scale_factor])

Normalize the points to a fixed distance between two particular points.

normalize_distribution([mu, std, axis])

Normalize points distribution.

read(buffer[, pose_body])

Read Pose object from buffer.

unnormalize_distribution(mu, std)

Given mean, standard deviationn unnormalization applied to the pose points distribution.

write(buffer)

Write Pose object to buffer.

Attributes:

pass_through_methods

A set of method names which define actions that can be applied to the pose data.

bbox()[source]

Calculates bounding box for Pose.

Returns:

Pose object representing bounding box (bbox).

Return type:

Pose

focus()[source]

Gets the pose to start at (0,0) and have dimensions as big as needed

frame_dropout_normal(dropout_mean=0.5, dropout_std=0.1)[source]

Normal frame dropout on Pose.

Parameters:
  • dropout_mean (float, optional) – Mean value for dropout. Defaults to 0.5.

  • dropout_std (float, optional) – Standard deviation for dropout. Defaults to 0.1.

Returns:

a tuple with Pose of dropped frames and a list of selected indexes.

Return type:

tuple

frame_dropout_uniform(dropout_min=0.2, dropout_max=1.0)[source]

Perform uniform frame dropout on Pose

Parameters:
  • dropout_min (float, optional) – Minimum dropout value. Defaults to 0.2.

  • dropout_max (float, optional) – Maximum dropout value. Defaults to 1.0.

Returns:

a tuple containing Pose with dropped frames and a list of selected indexes.

Return type:

tuple

get_components(components, points=None)[source]

get pose components based on criteria.

Parameters:
  • components (List[str]) – List of component names to get.

  • points (Dict[str, List[str]], optional) – Mapping of component names to lists of point names to get.

Returns:

Pose object containing new components

Return type:

Pose

normalize(info, scale_factor=1)[source]

Normalize the points to a fixed distance between two particular points.

Parameters:
  • info (PoseNormalizationInfo) – Information for normalization.

  • scale_factor (float, optional) – Scaling factor. Defaults to 1.

Returns:

The normalized Pose object.

Return type:

Pose

normalize_distribution(mu=None, std=None, axis=(0, 1))[source]

Normalize points distribution.

Parameters:
  • mu (np.ndarray, optional) – Mean values for normalization. If None, it will be computed.

  • std (np.ndarray, optional) – Standard deviation values for normalization. If None, it will be computed.

  • axis (tuple of int, optional) – Axes for mean and std computation. Defaults to (0, 1).

Returns:

Calculated mean and standard deviation.

Return type:

tuple of np.ndarray

pass_through_methods = {'augment2d', 'flip', 'interpolate', 'slice_step', 'tensorflow', 'torch'}

A set of method names which define actions that can be applied to the pose data.

Parameters:
  • augment2d (str) – Represents a method to augment 2D points.

  • flip (str) – Represents a method to flip the pose on an axis.

  • interpolate (str) – Represents a method to interpolate missing pose points.

  • torch (str) – Represents a method to convert the body data to torch format.

  • tensorflow (str) – Represents a method to convert the body data to TensorFlow format.

  • slice_step (str) – Represents a method to step through the data.

static read(buffer, pose_body=<class 'pose_format.numpy.pose_body.NumPyPoseBody'>, **kwargs)[source]

Read Pose object from buffer.

Parameters:
  • buffer (bytes) – The input buffer.

  • pose_body (Type[PoseBody], optional) – The type of pose body to be read. Defaults to NumPyPoseBody.

Returns:

Pose object.

Return type:

Pose

unnormalize_distribution(mu, std)[source]

Given mean, standard deviationn unnormalization applied to the pose points distribution.

Parameters:
  • mu (np.ndarray) – The mean values used for normalization.

  • std (np.ndarray) – The standard deviation values used for normalization.

write(buffer)[source]

Write Pose object to buffer.

Parameters:

buffer (BinaryIO) – buffer

pose_format.pose_body module

Classes:

PoseBody(fps, data, confidence)

Class for body data of a pose.

class pose_format.pose_body.PoseBody(fps, data, confidence)[source]

Bases: object

Class for body data of a pose.

Parameters:
  • fps (float) – Frames per second.

  • data – Data in the format (Frames, People, Points, Dims) e.g., (93, 1, 137, 2).

  • confidence – Confidence data in the format (Frames, People, Points) e.g., (93, 1, 137).

Methods:

augment2d([rotation_std, shear_std, scale_std])

Augment 2D data with given standard deviations.

bbox(header)

For computing bounding box of PoseBody.

flatten()

Converts data from the (Frames, People, Points, Dims) masked representation to an array of points.

frame_dropout_given_percent(dropout_percent)

Drop of frames based on given dropout percentage.

frame_dropout_normal([dropout_mean, dropout_std])

drop frames depending on normal distribution with given mean and standard deviation.

frame_dropout_uniform([dropout_min, dropout_max])

Randomly drops frames depending on a uniform distribution - given minimum and maximum percentages.

get_points(indexes)

Get points from PoseBody.

matmul(matrix)

Multiplies PoseBody data with a numpy.ndarray matrix.

numpy()

Convert the current PoseBody representation to NumpyPoseBody.

points_perspective()

Give points in PoseBody as a perspective view.

read(header, reader, **kwargs)

Reads pose data a buffer (BufferReader) based on the header's version.

read_v0_0(header, reader, **unused_kwargs)

reads version 0.0 pose data.

read_v0_1(header, reader[, start_frame, ...])

Reads pose data for version 0.1 from a buffer.

read_v0_1_frames(frames, shape, reader[, ...])

Reads frame data for version 0.1 from a buffer.

select_frames(frame_indexes)

Selects specific frames from PoseBody object.

slice_step(by)

Slices data by skipping rows.

tensorflow()

Converts current PoseBody representation to TensorflowPoseBody.

torch()

Converts current PoseBody to TorchPoseBody.

write(version, buffer)

Writes data to a file based on version of spec: in docs/spec.

zero_filled()

Creates a new PoseBody instance with data replaced by zeros.

Attributes:

tensor_reader

augment2d(rotation_std=0.2, shear_std=0.2, scale_std=0.2)[source]

Augment 2D data with given standard deviations.

Parameters:
  • rotation_std (float, optional) – Rotation in radians. Default is 0.2.

  • shear_std (float, optional) – Shear X in percent. Default is 0.2.

  • scale_std (float, optional) – Scale X in percent. Default is 0.2.

Returns:

Augmented PoseBody instance.

Return type:

PoseBody

Note

bbox(header)[source]

For computing bounding box of PoseBody.

Parameters:

header (PoseHeader) – Header containing the version of the pose data.

Returns:

PoseBody instance with bounding box.

Return type:

PoseBody

Raises:

NotImplementedError – If the bbox is not implemented in class.

flatten()[source]

Converts data from the (Frames, People, Points, Dims) masked representation to an array of points.

Every item in the result array contains the following dimensions: 0. Time in milliseconds 1. Person ID 2. Point ID 3. X dimension 4. Y dimension 5. Z dimension (if exists) 6. Pose estimation confidence

Returns:

Array of points with detailed dimensions.

Return type:

np.ndarray

Raises:

NotImplementedError – If the method is not implemented for the specific class.

frame_dropout_given_percent(dropout_percent)[source]

Drop of frames based on given dropout percentage.

Parameters:

dropout_percent (float) – Percentage of frames to drop. Between 0 and 1 (e.g., 0.2 means drop 20% of the frames).

Returns:

  • New PoseBody object with the gotten frames.

  • List of frame indexes.

Return type:

Tuple[PoseBody, List[int]]

Note

Actual number of dropped frames might be slightly different due to rounding!

frame_dropout_normal(dropout_mean=0.5, dropout_std=0.1)[source]

drop frames depending on normal distribution with given mean and standard deviation.

Parameters:
  • dropout_mean (float, optional) – Mean percentage of frames to drop. Default is 0.5.

  • dropout_std (float, optional) – Standard deviation of percentage of frames to drop. Default is 0.1.

Returns:

  • New PoseBody object with dropped frames.

  • List of retrieved frame indexes.

Return type:

Tuple[PoseBody, List[int]]

frame_dropout_uniform(dropout_min=0.2, dropout_max=1.0)[source]

Randomly drops frames depending on a uniform distribution - given minimum and maximum percentages.

Parameters:
  • dropout_min (float, optional) – Minimum percentage of frames to drop. Default is 0.2.

  • dropout_max (float, optional) – Maximum percentage of frames to drop. Default is 1.0.

Returns:

  • New PoseBody object with dropped frames.

  • List of frame indexes that were retained.

Return type:

Tuple[PoseBody, List[int]]

get_points(indexes)[source]

Get points from PoseBody.

Parameters:

indexes (List[int]) – List of point indices to get from PoseBody.

Returns:

PoseBody instance containing only choosen points.

Return type:

PoseBody

Raises:

NotImplementedError – If the get_points is not implemented in class.

matmul(matrix)[source]

Multiplies PoseBody data with a numpy.ndarray matrix.

Parameters:

matrix (np.ndarray) – The matrix to multiply the PoseBody data with.

Returns:

PoseBody instance with data multiplied by a numpy array.

Return type:

PoseBody

Raises:

NotImplementedError – If the matmul is not implemented in class.

numpy()[source]

Convert the current PoseBody representation to NumpyPoseBody.

Returns:

The converted PoseBody object.

Return type:

NumpyPoseBody

Raises:

NotImplementedError – If numpy is not implemented.

points_perspective()[source]

Give points in PoseBody as a perspective view.

Returns:

PoseBody instance with points adjusted for perspective.

Return type:

PoseBody

Raises:

NotImplementedError – If the method is not implemented for the specific class.

classmethod read(header, reader, **kwargs)[source]

Reads pose data a buffer (BufferReader) based on the header’s version.

Parameters:
  • header (PoseHeader) – Header containing the version of its pose data.

  • reader (BufferReader) – Buffer from which to read the pose data.

  • **kwargs (dict) – Additional parameters for reading specific versions.

Returns:

PoseBody object initialized with the read data.

Return type:

PoseBody

Raises:

NotImplementedError – If header’s version is not supported / unknown.

classmethod read_v0_0(header, reader, **unused_kwargs)[source]

reads version 0.0 pose data.

Parameters:
  • header (PoseHeader) – Header containing the version of the pose data.

  • reader (BufferReader) – Buffer from which to read the pose data.

  • unused_kwargs (dict) – Unused additional parameters for this version.

Raises:

NotImplementedError – method for this version is not implemented.

classmethod read_v0_1(header, reader, start_frame=None, end_frame=None, **unused_kwargs)[source]

Reads pose data for version 0.1 from a buffer.

Parameters:
  • header (PoseHeader) – Header containing the version of the pose data.

  • reader (BufferReader) – Buffer from which to read the pose data.

  • start_frame (int, optional) – Index of the first frame to read. Default is None.

  • end_frame (int, optional) – Index of the last frame to read. Default is None.

  • **unused_kwargs (dict) – Unused additional parameters for this version.

Returns:

PoseBody object initialized with the read data for version 0.1.

Return type:

PoseBody

classmethod read_v0_1_frames(frames, shape, reader, start_frame=None, end_frame=None)[source]

Reads frame data for version 0.1 from a buffer.

Parameters:
  • frames (int) – Number of frames in the pose data.

  • shape (List[int]) – Shape of the pose data.

  • reader (BufferReader) – Buffer from which to read the pose data.

  • start_frame (int, optional) – Index of the first frame to read. Default is None.

  • end_frame (int, optional) – Index of the last frame to read. Default is None.

Returns:

Array containing the pose data for the specified frames.

Return type:

ndarray

Raises:

ValueError – If start_frame is greater than number of frames.

select_frames(frame_indexes)[source]

Selects specific frames from PoseBody object.

Parameters:

frame_indexes (List[int]) – List of frame indexes to select.

Returns:

PoseBody object containing only the selected frames.

Return type:

PoseBody

Raises:

IndexError – If any of the specified frame indices are out of the valid range for the current PoseBody data.

slice_step(by)[source]

Slices data by skipping rows. This affects the fps (frames per seconds).

Parameters:

by (int) – Take one row every “by” rows.

Returns:

PoseBody instance with sliced data.

Return type:

PoseBody

tensor_reader = 'ABSTRACT-DO-NOT-USE'
tensorflow()[source]

Converts current PoseBody representation to TensorflowPoseBody.

Returns:

Converted PoseBody object.

Return type:

TensorflowPoseBody

Raises:

NotImplementedError – If tensorflow is not implemented.

torch()[source]

Converts current PoseBody to TorchPoseBody.

Returns:

The converted PoseBody object.

Return type:

TorchPoseBody

Raises:

NotImplementedError – If toch is not implemented.

write(version, buffer)[source]

Writes data to a file based on version of spec: in docs/spec.

Parameters:
  • version (float) – Version of the pose data to write.

  • buffer (BinaryIO) – Buffer to write the pose data to.

zero_filled()[source]

Creates a new PoseBody instance with data replaced by zeros.

Returns:

PoseBody instance with zero-filled data.

Return type:

PoseBody

Raises:

NotImplementedError – If the zero_filled is not implemented on class .

pose_format.pose_header module

Classes:

PoseHeader(version, dimensions, components)

Main header for a pose.

PoseHeaderComponent(name, points, limbs, ...)

Class for pose header component

PoseHeaderDimensions(width, height[, depth])

Represents width, height, and depth dimensions for a pose header.

PoseNormalizationInfo(p1, p2[, p3])

This class represents is used for normalization info for pose.

class pose_format.pose_header.PoseHeader(version, dimensions, components, is_bbox=False)[source]

Bases: object

Main header for a pose.

Parameters:
  • version (float) – Version of the pose header.

  • dimensions (PoseHeaderDimensions) – Dimensions of the pose header.

  • components (List[PoseHeaderComponent]) – List of pose header components.

  • is_bbox (bool, optional) – If bounding box needed. Default is False.

Note

  • Use the read method to generate an instance from a BufferReader.

  • total_points method returns the total number of points across all components.

  • Convert the header to bounding boxes using the bbox method.

Examples

>>> header = PoseHeader(1.0, PoseHeaderDimensions(10, 20, 5), [PoseHeaderComponent(...)], is_bbox=True)
>>> print(header.is_bbox)
True

Methods:

bbox()

Converts header to bounding boxes (bbox).

normalization_info(p1, p2[, p3])

Normalizates info for given points.

read(reader)

Reads pose header data from a reader (BufferReader).

total_points()

Returns number of points

write(buffer)

Writes the pose header to a buffer (BinaryIO).

bbox()[source]

Converts header to bounding boxes (bbox).

Returns:

PoseHeader with bounding box information.

Return type:

PoseHeader

normalization_info(p1, p2, p3=None)[source]

Normalizates info for given points.

Parameters:
  • p1 (Tuple[str, str]) – First point.

  • p2 (Tuple[str, str]) – Second point.

  • p3 (Tuple[str, str], optional) – Third point.

Returns:

Normalization information for the points.

Return type:

PoseNormalizationInfo

static read(reader)[source]

Reads pose header data from a reader (BufferReader).

Parameters:

reader (BufferReader) – Reader object.

Returns:

An instance of PoseHeader.

Return type:

PoseHeader

total_points()[source]

Returns number of points

Returns:

Total number of points.

Return type:

int

write(buffer)[source]

Writes the pose header to a buffer (BinaryIO).

Parameters:

buffer (BinaryIO) – Buffer to write data into.

class pose_format.pose_header.PoseHeaderComponent(name, points, limbs, colors, point_format)[source]

Bases: object

Class for pose header component

Parameters:
  • name (str) – Name of the pose header component

  • points (List[str]) – List of point names.

  • limbs (List[Tuple[int, int]]) – List of limb indices.

  • colors (List[Tuple[int, int, int]]) – List of RGB colors for each limb.

  • point_format (str) – Format for the points.

Note

Limbs and colors should have the same length. The index in the limbs list corresponds to a color in the colors list.

Methods:

get_relative_limbs()

Get relative limbs mapping.

read(version, reader)

Reads pose header dimensions from reader (BufferReader).

write(buffer)

Writes pose header dimensions to a buffer (BinaryIO).

get_relative_limbs()[source]

Get relative limbs mapping.

Constructs a mapping from the second point in each limb tuple to its index in the limbs list. Then, it attempts to map each first point in the limbs tuple to its corresponding index.

Returns:

List of relative limb indices or None if the limb does not have a relative mapping.

Return type:

list

Note

returned list is based on the self.limbs of the instance, its structure is expected to be a list of tuples, where each tuple represents a limb with two points.

static read(version, reader)[source]

Reads pose header dimensions from reader (BufferReader).

Parameters:
  • version (float) – Version information.

  • reader (BufferReader) – Reader object.

Returns:

instance of PoseHeaderDimensions.

Return type:

PoseHeaderDimensions

write(buffer)[source]

Writes pose header dimensions to a buffer (BinaryIO).

Parameters:

buffer (BinaryIO) – Buffer to write data info.

Raises:

ValueError – If dimension value is out of bounds.

class pose_format.pose_header.PoseHeaderDimensions(width, height, depth=0, *args)[source]

Bases: object

Represents width, height, and depth dimensions for a pose header.

Parameters:
  • width (int) – Width of the pose.

  • height (int) – Height of the pose.

  • depth (int) – Depth of the pose. Defaults to 0.

Raises:

ValueError – If any dimension value is out of bounds (0 to 65535).

Examples

>>> dimensions = PoseHeaderDimensions(10, 20, 5)
>>> print(dimensions.width)
10

Methods:

read(version, reader)

Reads and returns a PoseHeaderDimensions object from a buffer reader.

write(buffer)

Writes dimensions to a buffer.

static read(version, reader)[source]

Reads and returns a PoseHeaderDimensions object from a buffer reader.

Parameters:
  • version (float) – Version of the data being read.

  • reader (BufferReader) – The reader

Returns:

Instance of PoseHeaderDimensions with its read dimensions (width, height, depth).

Return type:

PoseHeaderDimensions

write(buffer)[source]

Writes dimensions to a buffer.

Parameters:

buffer (BinaryIO) – Buffer to which dimensions (width, height, depth) will be written.

Raises:

ValueError – If any dimension value is out of bounds (0 to 65535).

class pose_format.pose_header.PoseNormalizationInfo(p1, p2, p3=None)[source]

Bases: object

This class represents is used for normalization info for pose.

Parameters:
  • p1 (int) – First pose value

  • p2 (int) – Second pose value.

  • p3 (int, optional) – Third pose value. Defaults to None.

pose_format.pose_representation module

Classes:

PoseRepresentation(header[, rep_modules1, ...])

Represents a pose using various representation modules.

class pose_format.pose_representation.PoseRepresentation(header, rep_modules1=[], rep_modules2=[], rep_modules3=[])[source]

Bases: object

Represents a pose using various representation modules.

Parameters:
  • header (PoseHeader) – Header information about the pose.

  • rep_modules1 (List, optional) – List of modules that use a point-based representation. Defaults to an empty list.

  • rep_modules2 (List, optional) – List of modules that use a limb-based representation. Defaults to an empty list.

  • rep_modules3 (List, optional) – List of modules that use a triangle-based representation. Defaults to an empty list.

input_size

Combined point count across all components of the header.

Type:

int

rep_modules1_size

The size represented by the point-based modules.

Type:

int

rep_modules2_size

The size represented by the limb-based modules.

Type:

int

rep_modules3_size

The size represented by the triangle-based modules.

Type:

int

output_size

The overall size of the output representation.

Type:

int

Methods:

calc_output_size()

Calculate total size of output representation, based on active modules

get_limbs_points()

Get points that define limbs

get_points(tensor, points)

get points from a given tensor

get_triangles_points()

Get points that make up triangles.

group_embeds(embeds)

Groups given embeddings into a desired format.

permute(src, shape)

Permutes given tensor according to shape.

calc_output_size()[source]

Calculate total size of output representation, based on active modules

Returns:

Total size of the module representation.

Return type:

int

get_limbs_points()[source]

Get points that define limbs

Returns:

Two lists containing points that define the start and end of each limb.

Return type:

Tuple[List, List]

get_points(tensor, points)[source]

get points from a given tensor

Parameters:
  • tensor (torch.Tensor) – Tensor from which you need the points.

  • points (List[int]) – Indices of points that need to be extracted.

Returns:

Gotten points from tensor.

Return type:

torch.Tensor

get_triangles_points()[source]

Get points that make up triangles.

Returns:

Three lists which have points that define each corner of the triangles.

Return type:

Tuple[List, List, List]

group_embeds(embeds)[source]

Groups given embeddings into a desired format. Must be implemented by subclasses.

Parameters:

embeds (List) – List of tensor embeddings, tensor size: (embed_size, Batch, Len).

Raises:

NotImplementedError – If the method is not implemented by subclasses.

Return type:

Size (Batch, Len, embed_size)

permute(src, shape)[source]

Permutes given tensor according to shape.

Parameters:
  • src (torch.Tensor) – Tensor to permute.

  • shape (tuple) – Desired shape of permuted tensor.

Raises:

NotImplementedError – If method is not implemented by subclasses.

pose_format.pose_test module

pose_format.pose_visualizer module

Classes:

FastAndUglyPoseVisualizer(pose[, thickness])

This class draws all frames as grayscale, without opacity based on confidence values.

PoseVisualizer(pose[, thickness])

A class for visualizing Pose objects using OpenCV.

class pose_format.pose_visualizer.FastAndUglyPoseVisualizer(pose, thickness=None)[source]

Bases: PoseVisualizer

This class draws all frames as grayscale, without opacity based on confidence values. It is a faster and less detailed “ugly” class for visualizing Pose objects using OpenCV.

  • Inherites from PoseViszaizer

Methods:

draw([background_color, foreground_color])

draws the pose on plain background using a foreground (pose) color.

Parameters:

pose (Pose) –

draw(background_color=0, foreground_color=255)[source]

draws the pose on plain background using a foreground (pose) color.

Parameters:
  • background_color (int) – Grayscale value for background color.

  • foreground_color (int) – Grayscale value for the pose color.

Yields:

np.ndarray – frames with drawn pose

class pose_format.pose_visualizer.PoseVisualizer(pose, thickness=None)[source]

Bases: object

A class for visualizing Pose objects using OpenCV.

Parameters:
  • pose (Pose) – The Pose object to visualize.

  • thickness (int or None) – Thickness for drawing. If not provided, it is estimated based on image size.

  • pose_fps (float) – Frame rate of the Pose data.

  • *cv2 (module) – OpenCV Python binding.

Methods:

draw([background_color, max_frames])

draws pose on plain background using the specified color - for a number of frames.

draw_on_video(background_video[, ...])

Draw pose on a background video.

save_frame(f_name, frame)

Save a single pose frame as im.

save_gif(f_name, frames)

Save pose frames as GIF.

save_video(f_name, frames[, custom_ffmpeg])

Save pose frames as a video.

draw(background_color=(255, 255, 255), max_frames=None)[source]

draws pose on plain background using the specified color - for a number of frames.

Parameters:
  • background_color (Tuple[int, int, int], optional) – RGB value for background color, default is white (255, 255, 255).

  • max_frames (int, optional) – Maximum number of frames to process, if it is None, it processes all frames.

Yields:

np.ndarray – Frames with the pose data drawn on a custom background color.

draw_on_video(background_video, max_frames=None, blur=False)[source]

Draw pose on a background video.

Parameters:
  • background_video (str or iterable) – Path to video file or iterable of video frames.

  • max_frames (int, optional) – Maximum number of frames to process. If None, it will be processing all frames.

  • blur (bool, optional) – If True, applies a blur effect to the video.

Yields:

np.ndarray – Frames with overlaid pose data.

save_frame(f_name, frame)[source]

Save a single pose frame as im.

Parameters:
  • f_name (str) – filensmr where the frame will be saved.

  • frame (np.ndarray) – Pose frame to be saved

Return type:

None

save_gif(f_name, frames)[source]

Save pose frames as GIF.

Parameters:
  • f_name (str) – filename to save GIF to.

  • frames (Iterable[np.ndarray]) – Series of pose frames to be included in GIF.

Return type:

None

Raises:

ImportError – If Pillow is not installed.

save_video(f_name, frames, custom_ffmpeg=None)[source]

Save pose frames as a video.

Parameters:
  • f_name (str) – Filename to which the generated video is saved to .

  • frames (Iterable[np.ndarray]) – Iterable of pose frames include in the video.

  • custom_ffmpeg (optional) – Custom ffmpeg parameters for the “video writing”.

Return type:

None

Raises:

ImportError – If vidgear is not installed.