modify

Tools to modify poses detected via a Detector

source

add_poseflow_figures

 add_poseflow_figures (input_detections, json_path)

source

output_alphapose_json

 output_alphapose_json (poses_series, figure_type='figures')

source

interpolate_missing_coords

 interpolate_missing_coords (input_frames, threshold=0.5,
                             flip_figures=False, check_bbox=False,
                             all_visible=True, overlap_threshold=0.7,
                             video_file=None, figure_type='figures')

source

trim_empty_frames_start_end

 trim_empty_frames_start_end (input_frames, figure_type='figures')

source

interpolate_missing_poses

 interpolate_missing_poses (input_frames, threshold=0.2, video_file=None,
                            figure_type='figures', trim_ends=True)

source

is_usable_pose

 is_usable_pose (frame_info, threshold=0.2, figure_type='figures')

source

add_flipped_zeroified_figures

 add_flipped_zeroified_figures (input_frames, add_flipped=True,
                                add_zerofied=True, figure_type='figures')

source

correct_pose

 correct_pose (input_coords)

source

right_ankle_from_knee

 right_ankle_from_knee (coords, missing_coords)

source

left_ankle_from_knee

 left_ankle_from_knee (coords, missing_coords)

source

right_hip_btwn_shoulder_knee_ankle

 right_hip_btwn_shoulder_knee_ankle (coords, missing_coords)

source

left_hip_btwn_shoulder_knee_ankle

 left_hip_btwn_shoulder_knee_ankle (coords, missing_coords)

source

right_elbow_btwn_shoulder_wrist

 right_elbow_btwn_shoulder_wrist (coords, missing_coords)

source

left_elbow_btwn_shoulder_wrist

 left_elbow_btwn_shoulder_wrist (coords, missing_coords)

source

right_ear_btwn_eye_shoulder

 right_ear_btwn_eye_shoulder (coords, missing_coords)

source

left_ear_btwn_eye_shoulder

 left_ear_btwn_eye_shoulder (coords, missing_coords)

source

right_eye_btwn_nose_shoulder

 right_eye_btwn_nose_shoulder (coords, missing_coords)

source

left_eye_btwn_nose_shoulder

 left_eye_btwn_nose_shoulder (coords, missing_coords)

source

nose_btwn_eyes_ears_shoulders

 nose_btwn_eyes_ears_shoulders (coords, missing_coords)

source

count_figures_and_time

 count_figures_and_time (input_frames, figure_type='figures')

source

average_coords

 average_coords (coord1, coord2)

source

shift_figure

 shift_figure (coords_and_confidence, dx, dy)

source

get_union

 get_union (a, b)

source

get_intersect

 get_intersect (a, b)

source

in_bbox_check

 in_bbox_check (coord, bbox, margin=0.5)

source

get_bbox_area

 get_bbox_area (bbox)

source

get_bbox

 get_bbox (pose_coords, move_to_origin=False, margin=0, width=None,
           height=None)

source

zeroify_detections_y_first

 zeroify_detections_y_first (input_detections, width=None, height=None)

Version of zeroify_detections from above that assumes Y, X order of coordinates, again with Y=0 at top left


source

zeroify_detections

 zeroify_detections (input_detections, width=None, height=None)

Modifies a figure’s coordinates so that the corner of its bounding box is at 0,0. This is mostly for visualization with PIL images, (note that PIL puts y=0 at the top). The modifications are done for all figures in a single frame.


source

flip_detections_y_first

 flip_detections_y_first (input_detections, flip_y=False, flip_x=False,
                          rectify_x=False,
                          mirror_coco_17_left_right=False)

Mirror the coordinates of a pose in place around the midpoint of either the Y or X axis. The former is sometimes necessary when working with image coordinates (0,0 at top left) vs. figure coordiantes (0,0 at bottom left). The latter is useful when the pose needs to be flipped as though it is being viewed in a mirror (which is often the case with dance videos).

This function flips all detected poses in a single frame. If the rectify_x flag is set, this function can also count how many coords are on the left or right side of the pose, and mirror the coordinates horizontally so that the most coords are always on stage right (viewer’s left) – in which case the parameter value of flip_x is ignored.


source

flip_detections

 flip_detections (input_detections, flip_y=False, flip_x=False,
                  rectify_x=False, y_first=False,
                  mirror_coco_17_left_right=False)

Mirror the coordinates of a pose in place around the midpoint of either the Y or X axis. The former is sometimes necessary when working with image coordinates (0,0 at top left) vs. figure coordiantes (0,0 at bottom left). The latter is useful when the pose needs to be flipped as though it is being viewed in a mirror (which is often the case with dance videos).

This function flips all detected poses in a single frame. If the rectify_x flag is set, this function can also count how many coords are on the left or right side of the pose, and mirror the coordinates horizontally so that the most coords are always on stage right (viewer’s left) – in which case the parameter value of flip_x is ignored.


source

get_figure_coords_y_first

 get_figure_coords_y_first (coords_and_confidence, margin=0)

source

get_figure_coords

 get_figure_coords (coords_and_confidence, margin=0)