Capture¶
Native recordings, timelines, tracks, sources, registration, and estimator protocols.
capture
¶
Typed native recordings and capture processing.
Modules:
| Name | Description |
|---|---|
alignment |
Temporal and spatial registration for native recordings. |
estimators |
Replaceable human-pose estimator interfaces. |
recordings |
Typed native recording models. |
sources |
Observation sources for native recordings. |
timeline |
Native and observation timeline primitives. |
tracks |
Typed recording tracks with type-specific resampling. |
Classes:
| Name | Description |
|---|---|
AlignmentError |
Registration failure carrying the rejected quality report. |
AlignmentReport |
Quality report for one temporal or spatial registration. |
RigidTransform |
Rigid point transform |
TemporalRegistrationConfig |
Quality and search policy for offset registration. |
GvhmrEstimator |
Run a configured local GVHMR checkout in an ephemeral workspace. |
HumanPoseEstimator |
Estimate a typed human-pose recording from video. |
VideoPoseSource |
Compose a video recording source with a pose estimator. |
HumanPoseRecording |
Estimated or measured human pose in one native clock. |
MocapRecording |
Joints, rigid bodies, and markers sampled in one native mocap clock. |
VideoRecording |
A video stream and its native frame timeline. |
GvhmrOutputSource |
Load existing GVHMR arrays as a native human-pose recording. |
HumanPoseSourceSchema |
Map semantic motion-joint vocabularies to source array columns. |
InMemorySource |
Source returning an already constructed recording. |
MocapArraySource |
Load a dense |
ObservationSource |
Load one native recording without creating a shared timeline. |
ViconBagSource |
Read a ROS 2 Vicon bag directly into a native mocap recording. |
ViconBagTopics |
ROS topics carrying Vicon rigid-body transforms and marker samples. |
ViconRecordingSource |
Load a preconverted Vicon recording directly into typed tracks. |
ViconSourceSchema |
Map Vicon table names into typed native vocabularies. |
ClockTransform |
Affine mapping from a native clock into an observation clock. |
SampleTimeline |
Strictly increasing sample timestamps in one recording's native clock. |
CategoricalTrack |
A named categorical sequence sampled by nearest neighbor. |
JointTrack |
A native or estimated human-joint trajectory. |
MarkerTrack |
A native motion-capture marker trajectory. |
PointTrack |
A named 3D point trajectory. |
PoseTrack |
A named rigid-body pose trajectory. |
RigidBodyTrack |
A native motion-capture rigid-body trajectory. |
Functions:
| Name | Description |
|---|---|
estimate_clock_offset |
Estimate an offset mapping |
register_rigid_points |
Estimate a Kabsch rigid transform from corresponding finite points. |
Attributes:
| Name | Type | Description |
|---|---|---|
__all__ |
|
Attributes¶
__all__
module-attribute
¶
__all__ = [
"AlignmentError",
"AlignmentReport",
"CategoricalTrack",
"ClockTransform",
"GvhmrEstimator",
"GvhmrOutputSource",
"HumanPoseEstimator",
"HumanPoseRecording",
"HumanPoseSourceSchema",
"InMemorySource",
"JointTrack",
"MarkerTrack",
"MocapArraySource",
"MocapRecording",
"ObservationSource",
"PointTrack",
"PoseTrack",
"RigidBodyTrack",
"RigidTransform",
"SampleTimeline",
"TemporalRegistrationConfig",
"ViconBagSource",
"ViconBagTopics",
"ViconRecordingSource",
"ViconSourceSchema",
"VideoPoseSource",
"VideoRecording",
"estimate_clock_offset",
"register_rigid_points",
]
Classes¶
AlignmentError
¶
AlignmentError(message: str, report: AlignmentReport)
AlignmentReport
dataclass
¶
AlignmentReport(
strategy: str,
accepted: bool,
score: float,
sample_count: int,
overlap_s: float | None = None,
clock_transform: ClockTransform | None = None,
rms_error: float | None = None,
diagnostics: dict[str, object] = dict(),
)
Quality report for one temporal or spatial registration.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
str
|
|
accepted |
bool
|
|
score |
float
|
|
sample_count |
int
|
|
overlap_s |
float | None
|
|
clock_transform |
ClockTransform | None
|
|
rms_error |
float | None
|
|
diagnostics |
dict[str, object]
|
|
RigidTransform
dataclass
¶
RigidTransform(rotation: FloatArray, translation: FloatArray)
Rigid point transform target = source @ rotation.T + translation.
Methods:
| Name | Description |
|---|---|
apply |
Transform points with trailing dimension 3. |
Attributes:
| Name | Type | Description |
|---|---|---|
rotation |
FloatArray
|
|
translation |
FloatArray
|
|
TemporalRegistrationConfig
dataclass
¶
TemporalRegistrationConfig(
max_abs_offset_s: float,
min_overlap_s: float = 0.5,
minimum_score: float = 0.2,
coarse_steps: int = 1001,
activity_weighted: bool = True,
)
Quality and search policy for offset registration.
Attributes:
| Name | Type | Description |
|---|---|---|
max_abs_offset_s |
float
|
|
min_overlap_s |
float
|
|
minimum_score |
float
|
|
coarse_steps |
int
|
|
activity_weighted |
bool
|
|
Attributes¶
GvhmrEstimator
dataclass
¶
GvhmrEstimator(
checkout: Path,
command: tuple[str, ...],
schema: HumanPoseSourceSchema,
fps: float,
frame: FrameConvention = Y_UP_RIGHT_HANDED,
source_height_m: float | None = None,
)
Run a configured local GVHMR checkout in an ephemeral workspace.
Command entries may contain {video}, {workspace}, {output}, and
{checkout} placeholders. The configured command must write
joints.npy into {output}.
Methods:
| Name | Description |
|---|---|
estimate |
Run GVHMR and load its output before deleting temporary files. |
Attributes:
| Name | Type | Description |
|---|---|---|
checkout |
Path
|
|
command |
tuple[str, ...]
|
|
schema |
HumanPoseSourceSchema
|
|
fps |
float
|
|
frame |
FrameConvention
|
|
source_height_m |
float | None
|
|
Attributes¶
Functions¶
estimate
¶
estimate(recording: VideoRecording) -> HumanPoseRecording
Run GVHMR and load its output before deleting temporary files.
HumanPoseEstimator
¶
VideoPoseSource
dataclass
¶
VideoPoseSource(video: VideoRecording, estimator: HumanPoseEstimator)
Compose a video recording source with a pose estimator.
Methods:
| Name | Description |
|---|---|
load |
Estimate and return human pose. |
Attributes:
| Name | Type | Description |
|---|---|---|
video |
VideoRecording
|
|
estimator |
HumanPoseEstimator
|
|
HumanPoseRecording
dataclass
¶
HumanPoseRecording(
name: str,
timeline: SampleTimeline,
frame: FrameConvention,
joints: tuple[JointTrack, ...],
root_pose: PoseTrack | None = None,
source_height_m: float | None = None,
vertices: FloatArray | None = None,
provenance: dict[str, object] | None = None,
)
Estimated or measured human pose in one native clock.
Methods:
| Name | Description |
|---|---|
joint |
Return one joint track. |
to_motion_sequence |
Materialize the canonical shared-timeline actor motion after fusion. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
timeline |
SampleTimeline
|
|
frame |
FrameConvention
|
|
joints |
tuple[JointTrack, ...]
|
|
root_pose |
PoseTrack | None
|
|
source_height_m |
float | None
|
|
vertices |
FloatArray | None
|
|
provenance |
dict[str, object] | None
|
|
joint_roles |
tuple[NameEnum, ...]
|
Ordered joint vocabulary. |
Attributes¶
Functions¶
to_motion_sequence
¶
to_motion_sequence(root_joint: MotionJoint) -> MotionSequence[MotionJoint]
Materialize the canonical shared-timeline actor motion after fusion.
MocapRecording
dataclass
¶
MocapRecording(
name: str,
timeline: SampleTimeline,
frame: FrameConvention,
joints: tuple[JointTrack, ...] = (),
rigid_bodies: tuple[RigidBodyTrack, ...] = (),
markers: tuple[MarkerTrack, ...] = (),
provenance: dict[str, object] | None = None,
)
Joints, rigid bodies, and markers sampled in one native mocap clock.
Methods:
| Name | Description |
|---|---|
rigid_body |
Return one rigid-body track. |
joint |
Return one mocap joint track. |
marker |
Return one marker track. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
timeline |
SampleTimeline
|
|
frame |
FrameConvention
|
|
joints |
tuple[JointTrack, ...]
|
|
rigid_bodies |
tuple[RigidBodyTrack, ...]
|
|
markers |
tuple[MarkerTrack, ...]
|
|
provenance |
dict[str, object] | None
|
|
VideoRecording
dataclass
¶
VideoRecording(
name: str,
path: Path,
timeline: SampleTimeline,
frame_size: tuple[int, int] | None = None,
provenance: dict[str, object] | None = None,
)
A video stream and its native frame timeline.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
path |
Path
|
|
timeline |
SampleTimeline
|
|
frame_size |
tuple[int, int] | None
|
|
provenance |
dict[str, object] | None
|
|
Attributes¶
GvhmrOutputSource
dataclass
¶
GvhmrOutputSource(
path: Path,
schema: HumanPoseSourceSchema,
fps: float,
frame: FrameConvention = Y_UP_RIGHT_HANDED,
name: str = "",
source_height_m: float | None = None,
load_vertices: bool = False,
)
Load existing GVHMR arrays as a native human-pose recording.
Methods:
| Name | Description |
|---|---|
load |
Load GVHMR joint output without creating a synchronized file. |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
schema |
HumanPoseSourceSchema
|
|
fps |
float
|
|
frame |
FrameConvention
|
|
name |
str
|
|
source_height_m |
float | None
|
|
load_vertices |
bool
|
|
HumanPoseSourceSchema
dataclass
¶
HumanPoseSourceSchema(joint_indices: Mapping[MotionJoint, int])
Map semantic motion-joint vocabularies to source array columns.
Attributes:
| Name | Type | Description |
|---|---|---|
joint_indices |
Mapping[MotionJoint, int]
|
|
Attributes¶
InMemorySource
dataclass
¶
InMemorySource(recording: RecordingT)
MocapArraySource
dataclass
¶
MocapArraySource(
path: Path,
joint_vocabulary: type[MotionJoint],
fps: float,
frame: FrameConvention = Z_UP_RIGHT_HANDED,
downsample: int = 1,
name: str = "",
)
Load a dense (frames, joints, 3) mocap array.
Methods:
| Name | Description |
|---|---|
load |
Load the array as typed native mocap joint tracks. |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
joint_vocabulary |
type[MotionJoint]
|
|
fps |
float
|
|
frame |
FrameConvention
|
|
downsample |
int
|
|
name |
str
|
|
ObservationSource
¶
ViconBagSource
dataclass
¶
ViconBagSource(
path: Path,
schema: ViconSourceSchema,
topics: ViconBagTopics = ViconBagTopics(),
frame: FrameConvention = Z_UP_RIGHT_HANDED,
name: str = "",
transform_scale_m: float = 1.0,
marker_scale_m: float = 0.001,
)
Read a ROS 2 Vicon bag directly into a native mocap recording.
The optional capture-ros dependency is imported only when :meth:load
runs. The bag is never converted into a persistent table or archive.
Methods:
| Name | Description |
|---|---|
load |
Deserialize configured bag topics into typed Vicon tracks. |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
schema |
ViconSourceSchema
|
|
topics |
ViconBagTopics
|
|
frame |
FrameConvention
|
|
name |
str
|
|
transform_scale_m |
float
|
|
marker_scale_m |
float
|
|
ViconBagTopics
dataclass
¶
ViconBagTopics(
transforms: tuple[str, ...] = ("/tf",),
markers: tuple[str, ...] = ("/vicon/markers",),
)
ROS topics carrying Vicon rigid-body transforms and marker samples.
Attributes:
| Name | Type | Description |
|---|---|---|
transforms |
tuple[str, ...]
|
|
markers |
tuple[str, ...]
|
|
ViconRecordingSource
dataclass
¶
ViconRecordingSource(
path: Path,
schema: ViconSourceSchema,
frame: FrameConvention = Z_UP_RIGHT_HANDED,
name: str = "",
)
Load a preconverted Vicon recording directly into typed tracks.
Methods:
| Name | Description |
|---|---|
load |
Load |
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path
|
|
schema |
ViconSourceSchema
|
|
frame |
FrameConvention
|
|
name |
str
|
|
ViconSourceSchema
dataclass
¶
ViconSourceSchema(
rigid_bodies: Mapping[str, MocapRigidBody],
markers: Mapping[str, MocapMarker],
rigid_body_order: tuple[str, ...] | None = None,
marker_order: tuple[str, ...] | None = None,
)
Map Vicon table names into typed native vocabularies.
Attributes:
| Name | Type | Description |
|---|---|---|
rigid_bodies |
Mapping[str, MocapRigidBody]
|
|
markers |
Mapping[str, MocapMarker]
|
|
rigid_body_order |
tuple[str, ...] | None
|
|
marker_order |
tuple[str, ...] | None
|
|
ClockTransform
dataclass
¶
ClockTransform(
scale: float = 1.0,
offset_s: float = 0.0,
source_clock: str = "native",
target_clock: str = "observation",
)
Affine mapping from a native clock into an observation clock.
The mapping is observation_time = scale * native_time + offset_s.
Methods:
| Name | Description |
|---|---|
apply |
Map timestamps into the target clock. |
timeline |
Map a complete timeline into the target clock. |
inverse |
Return the inverse clock mapping. |
Attributes:
| Name | Type | Description |
|---|---|---|
scale |
float
|
|
offset_s |
float
|
|
source_clock |
str
|
|
target_clock |
str
|
|
Attributes¶
Functions¶
timeline
¶
timeline(timeline: SampleTimeline) -> SampleTimeline
Map a complete timeline into the target clock.
SampleTimeline
dataclass
¶
SampleTimeline(timestamps: FloatArray, clock: str = 'native')
Strictly increasing sample timestamps in one recording's native clock.
Methods:
| Name | Description |
|---|---|
uniform |
Create a uniform timeline. |
slice |
Return a timeline subset. |
Attributes:
| Name | Type | Description |
|---|---|---|
timestamps |
FloatArray
|
|
clock |
str
|
|
sample_count |
int
|
Number of timestamps. |
start_s |
float
|
First timestamp. |
end_s |
float
|
Last timestamp. |
duration_s |
float
|
Duration between first and last timestamps. |
nominal_fps |
float | None
|
Median sampling rate, or |
Attributes¶
Functions¶
uniform
classmethod
¶
uniform(
sample_count: int, fps: float, *, start_s: float = 0.0, clock: str = "native"
) -> SampleTimeline
Create a uniform timeline.
CategoricalTrack
dataclass
¶
CategoricalTrack(
role: NameEnum,
values: tuple[NameEnum, ...],
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
A named categorical sequence sampled by nearest neighbor.
Methods:
| Name | Description |
|---|---|
resample |
Sample this track at the nearest native timestamp. |
Attributes:
| Name | Type | Description |
|---|---|---|
role |
NameEnum
|
|
values |
tuple[NameEnum, ...]
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object] | None
|
|
sample_count |
int
|
Number of samples. |
Attributes¶
Functions¶
resample
¶
resample(
source: SampleTimeline,
target: SampleTimeline,
*,
clock: ClockTransform | None = None,
) -> Self
Sample this track at the nearest native timestamp.
JointTrack
dataclass
¶
JointTrack(
role: NameEnum,
values: FloatArray,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
MarkerTrack
dataclass
¶
MarkerTrack(
role: NameEnum,
values: FloatArray,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
PointTrack
dataclass
¶
PointTrack(
role: NameEnum,
values: FloatArray,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
A named 3D point trajectory.
Methods:
| Name | Description |
|---|---|
resample |
Linearly interpolate this track onto |
Attributes:
| Name | Type | Description |
|---|---|---|
role |
NameEnum
|
|
values |
FloatArray
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object] | None
|
|
sample_count |
int
|
Number of samples. |
Attributes¶
Functions¶
resample
¶
resample(
source: SampleTimeline,
target: SampleTimeline,
*,
clock: ClockTransform | None = None,
) -> Self
Linearly interpolate this track onto target.
PoseTrack
dataclass
¶
PoseTrack(
role: NameEnum,
positions: FloatArray,
quaternions: FloatArray,
quaternion_order: QuaternionOrder = WXYZ,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
A named rigid-body pose trajectory.
Methods:
| Name | Description |
|---|---|
resample |
Linearly interpolate translation and SLERP orientation. |
Attributes:
| Name | Type | Description |
|---|---|---|
role |
NameEnum
|
|
positions |
FloatArray
|
|
quaternions |
FloatArray
|
|
quaternion_order |
QuaternionOrder
|
|
validity |
ndarray | None
|
|
provenance |
dict[str, object] | None
|
|
sample_count |
int
|
Number of samples. |
Attributes¶
Functions¶
resample
¶
resample(
source: SampleTimeline,
target: SampleTimeline,
*,
clock: ClockTransform | None = None,
) -> Self
Linearly interpolate translation and SLERP orientation.
RigidBodyTrack
dataclass
¶
RigidBodyTrack(
role: NameEnum,
positions: FloatArray,
quaternions: FloatArray,
quaternion_order: QuaternionOrder = WXYZ,
validity: ndarray | None = None,
provenance: dict[str, object] | None = None,
)
Functions¶
estimate_clock_offset
¶
estimate_clock_offset(
reference_timeline: SampleTimeline,
reference_signal: FloatArray,
moving_timeline: SampleTimeline,
moving_signal: FloatArray,
config: TemporalRegistrationConfig,
*,
target_clock: str = "observation",
) -> AlignmentReport
Estimate an offset mapping moving_timeline into reference_timeline.
register_rigid_points
¶
register_rigid_points(
source: FloatArray, target: FloatArray, *, maximum_rms_error: float | None = None
) -> tuple[RigidTransform, AlignmentReport]
Estimate a Kabsch rigid transform from corresponding finite points.