Experiment API¶
Configuration¶
body_eye_sync.experiment.config
¶
Serialisable definition of an experiment: its inputs and the pipeline to run.
BodyPoseStep
¶
Bases: _Model
Per-box body-pose detection. Fields mirror detect_body_poses.
Source code in src/body_eye_sync/experiment/config.py
ExperimentConfig
¶
Bases: _Model
The serialisable definition of an experiment: its inputs and the pipeline to run.
Source code in src/body_eye_sync/experiment/config.py
steps
property
¶
The pipeline stages that will run, in order.
FaceDetectionStep
¶
Bases: _Model
Per-box face detection. Fields mirror detect_faces.
Source code in src/body_eye_sync/experiment/config.py
ObjectTrackingStep
¶
Bases: _Model
Object detection + ReID tracking. Fields mirror detect_tracklets.
choices in a field's json_schema_extra are suggested values the GUI
offers in an editable combobox; a custom value is still allowed.
Source code in src/body_eye_sync/experiment/config.py
VideoInput
¶
Bases: _Model
A single video file to process, referenced by a stable id.
path may be relative; it is resolved against the experiment folder by the
runtime :class:Experiment.
Source code in src/body_eye_sync/experiment/config.py
Runtime Experiment¶
body_eye_sync.experiment.experiment
¶
Experiment contains the config, loaded inputs and tracking data / embeddings
Experiment
¶
An experiment: its :class:ExperimentConfig plus the loaded videos.
Source code in src/body_eye_sync/experiment/experiment.py
output_dir
property
¶
Where per-input Parquet outputs live, inside the folder.
load(folder)
classmethod
¶
Load the experiment in folder (its config; videos load on access).
Source code in src/body_eye_sync/experiment/experiment.py
output_path(spec)
¶
resolved_input_path(spec)
¶
Absolute path for spec; relative paths taken from the folder.
save(folder=None)
¶
Write the config, and every loaded video's results, into the folder.
folder defaults to the current :attr:folder and becomes it when
given. The config is always written; a video is written only once it has
results.
Source code in src/body_eye_sync/experiment/experiment.py
video(spec)
¶
The :class:Video for spec, created on first access.
Its cached outputs (data + embeddings) are loaded if they exist.
Source code in src/body_eye_sync/experiment/experiment.py
Running Experiments¶
body_eye_sync.experiment.run
¶
Run an :class:~body_eye_sync.experiment.experiment.Experiment non-interactively.
run_experiment(experiment, *, force=False)
¶
Run every input's pipeline and write one Parquet per input.
Outputs go to the experiment's outputs folder; existing ones are left
untouched unless force is set. Returns a mapping of input id to the
Parquet path written (or found).
Source code in src/body_eye_sync/experiment/run.py
run_input(experiment, spec)
¶
Run one input's pipeline stages in order, returning the populated Video.
Source code in src/body_eye_sync/experiment/run.py
Video Results¶
body_eye_sync.experiment.video
¶
Object tracking and vision model outputs for a video.
Video
¶
Contains object tracking and vision model outputs for a video.
Completed results live in a single numeric :attr:data DataFrame. While a
run is in progress, each frame's BoxMOT tracks array is accumulated and
collapsed into that DataFrame once :meth:finish_object_tracking is called.
Face detection runs as a later pass over those tracked boxes, accumulating
per frame and folding its columns onto the matching rows in
:meth:finish_face_detection. Body-pose detection follows the same pattern.
Source code in src/body_eye_sync/experiment/video.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
body_embeddings
property
¶
Best-K body-appearance embeddings per tracklet, or None.
data
property
¶
All tracked detections as a DataFrame, or None until complete.
face_embeddings
property
¶
Best-K face embeddings per tracklet, or None.
add_body_pose_frame(result)
¶
add_face_detection_frame(result)
¶
Accumulate one frame's detected faces for the final merge.
Source code in src/body_eye_sync/experiment/video.py
add_object_tracking_frame(frame)
¶
Accumulate a BoxMOT per-frame result, converting to 0-based indices
Source code in src/body_eye_sync/experiment/video.py
all_boxes_by_frame()
¶
Tracked person boxes grouped by frame, as later passes consume them.
Source code in src/body_eye_sync/experiment/video.py
begin_body_pose_detection(embeddings_per_track=0)
¶
Drop any previous pose columns so a fresh pass starts clean.
embeddings_per_track is accepted for a uniform begin_* signature
across steps but ignored -- pose detection produces no embeddings.
Source code in src/body_eye_sync/experiment/video.py
begin_face_detection(embeddings_per_track=0)
¶
Drop any previous face columns so a fresh pass starts clean.
embeddings_per_track keeps that many best face embeddings per
tracklet, ranked by face score, for later identity clustering.
Source code in src/body_eye_sync/experiment/video.py
begin_object_tracking(embeddings_per_track=0)
¶
Drop any previous model outputs.
embeddings_per_track keeps that many best body-appearance (ReID)
embeddings per tracklet, ranked by detection confidence, for later
identity clustering; 0 keeps none.
Source code in src/body_eye_sync/experiment/video.py
boxes_for_frame(frame_index)
¶
Object bounding boxes for frame frame_index (0-based).
Source code in src/body_eye_sync/experiment/video.py
discard_body_pose_detection()
¶
discard_face_detection()
¶
Drop a cancelled or failed pass; the tracked boxes are left intact.
discard_object_tracking()
¶
faces_for_frame(frame_index)
¶
Detected face boxes for frame frame_index (0-based).
Source code in src/body_eye_sync/experiment/video.py
finish_body_pose_detection()
¶
Merge the streamed poses onto their (frame, track_id) rows.
Source code in src/body_eye_sync/experiment/video.py
finish_face_detection()
¶
Merge the streamed faces onto their (frame, track_id) rows.
Source code in src/body_eye_sync/experiment/video.py
finish_object_tracking()
¶
Collapse the streamed frames into the stored :attr:data DataFrame.
from_parquet(path)
classmethod
¶
A new :class:Video loaded from a Parquet file (see :meth:load_parquet).
load_parquet(path)
¶
Load results written by :meth:to_parquet into this video.
Replaces any current results with the table at path and its companion
embeddings files (<stem>.body_embeddings.parquet /
<stem>.face_embeddings.parquet), if present.
Source code in src/body_eye_sync/experiment/video.py
poses_for_frame(frame_index)
¶
Detected body poses for frame frame_index (0-based).
Source code in src/body_eye_sync/experiment/video.py
set_data(data)
¶
Replace all results with a complete data DataFrame.
set_video(path)
¶
to_parquet(path)
¶
Write the completed :attr:data to a Parquet file.
Any collected embeddings are written to companion files beside path
(<stem>.body_embeddings.parquet / <stem>.face_embeddings.parquet).
Raises :class:ValueError if there is no completed data to write.