kodokan.viz#
Visualize a PoseSequence.
Two outputs, both requested by the project:
render_skeleton_video()— bake a shareable MP4 with the skeleton drawn either on the original video (overlay) or on a blank canvas (skeleton only).log_to_rerun()— log frames + 2D skeletons to a Rerun recording for interactive, scrubbable inspection (and side-by-side compare of two sequences).
Persons are drawn in distinct colors (slot 0 green, slot 1 magenta) so tori/uke are visually separable.
Module Attributes
BGR colors per person slot (green, magenta, cyan, yellow…). |
Functions
|
Log frames + 2D skeletons to Rerun (overlay-on-video and skeleton-only views). |
|
Render skeletons to an MP4. |
- kodokan.viz.DEFAULT_PERSON_COLORS = ((0, 255, 0), (255, 0, 255), (255, 255, 0), (0, 165, 255))#
BGR colors per person slot (green, magenta, cyan, yellow…).
- kodokan.viz.log_to_rerun(pose_seq, *, source_video=None, save=None, spawn=False, blank_canvas=True, frame_scale=0.5, conf_thresh=0.3, entity_prefix='')[source]#
Log frames + 2D skeletons to Rerun (overlay-on-video and skeleton-only views).
- Parameters:
pose_seq (
PoseSequence) – The sequence to log.source_video (
str|Path|None) – If given, downscaled frames are logged undervideo/as a backdrop.save (
str|Path|None) – Write a standalone.rrdrecording to this path.spawn (
bool) – Launch the Rerun viewer.blank_canvas (
bool) – Also log a skeleton-only view underskeleton/.frame_scale (
float) – Downscale factor for logged video frames (keypoints scaled to match).conf_thresh (
float) – Hide keypoints below this confidence.entity_prefix (
str) – Prefix all entity paths (use distinct prefixes to compare two sequences side-by-side in one recording, e.g."demoA/","demoB/").
- Return type:
- kodokan.viz.render_skeleton_video(pose_seq, *, out_path, source_video=None, blank_canvas=False, conf_thresh=0.3, fps=None, person_colors=((0, 255, 0), (255, 0, 255), (255, 255, 0), (0, 165, 255)), background=(0, 0, 0), thickness=2, radius=4)[source]#
Render skeletons to an MP4.
- Parameters:
pose_seq (
PoseSequence) – The pose sequence to draw.source_video (
str|Path|None) – Source clip; required (and used as backdrop) unlessblank_canvas=True.blank_canvas (
bool) – If True, draw on a solidbackgroundinstead of the video.conf_thresh (
float) – Hide keypoints/edges below this confidence.fps (
float|None) – Output fps (defaults to the sequence’s source fps).person_colors – BGR colors per person slot.
background – BGR background color for the blank canvas.
thickness (
int) – Edge thickness / joint radius in pixels.radius (
int) – Edge thickness / joint radius in pixels.
- Return type:
- Returns:
The output path.