Embedding¶
Embedding turns each frame of a chosen track into a feature vector for similarity and analysis. It renders the subject's masked input image and embeds it with an embedding model.
Parameters¶
Tracking run¶
tracking_run_id · string · required
Tracking run whose tracks to embed (e.g. track_01).
All tracks¶
all_tracks · boolean · default False
Embed every track in the run instead of a specific track list.
Model¶
model_id · string · default dinov3_vit
Embedding model to run (a registered model id). The default is DINOv3 ViT (dinov3_vit).
Size / variant¶
model_variant · string
Model size/variant (e.g. vit_base); omit for the model's default size (ViT-L for DINOv3 ViT).
Read-out¶
readout · string
Feature read-out: how the backbone output becomes one vector (model-dependent, e.g. pooler / cls_patch / gap / gmp / gap_gmp). Omit for the model's default.
Input image¶
constructor · string · default masked_color_centered_contrast
Named input-image constructor. The centered ones crop each mask and center it at true scale in a shared canvas. Ignored when a renderer_spec is given directly.
Input size¶
input_size · integer · range ≥ 1
Model input resolution (px), the square the model actually sees. Sets the backbone's image-processor size and the renderer's emitted size together. Omit for the model's own input size (e.g. 224 for DINOv3). Not every model is resizable.
Resize¶
resize · integer · range ≥ 1
Final square size the renderer emits (px), independent of the model input size. Omit to follow input_size or the model's own input size. The renderer then hands the model exactly that, instead of a larger canvas it re-downscales every frame.
Canvas scope¶
canvas_scope · string · default per_recording
How the centered constructors size their shared canvas across a multi-recording run: per_recording sizes it to each recording's own largest mask (normalizes away body-size differences between subjects); shared sizes it once to the largest mask over the whole selection (keeps true relative size, but a smaller subject then fills less of the model input). No effect on a single recording.
Use every¶
every_n_frames · integer · range ≥ 1
Use every Nth frame of the video. Omit to embed every frame the tracking run produced. Counted in source frames, so it must be a multiple of what tracking used: after tracking at 2, 4 embeds half of what it produced.
Batch size¶
batch_size · integer · default 32 · range 1–1024
Images per forward pass.
Egocentric alignment¶
align · string · default none
Egocentric alignment: make every animal face the same way before embedding. 'rotate' (overhead camera) turns each image so the head points right; 'mirror' (side camera) flips an animal facing left so it faces right; 'none' embeds the image as cropped. Needs a keypoint track run and a heading definition. A frame with no heading within the gap is not embedded, so an aligned run never mixes turned and unturned pictures.
Keypoint track run¶
keypoint_run_id · string
The keypoint track run (kt_NN) the heading is read from; it must come from this embedding's own tracking run.
Heading¶
heading · string
A saved heading definition: the skeleton points whose mean is the front and the points whose mean is the back. The heading is the direction from back to front, in pixels; the resolved definition is copied onto the run.
Fill heading gaps up to¶
max_gap_s · number · default 0.5 · range 0–30 · unit s
A frame without its own heading takes one interpolated across the gap to the nearest defined frames, when that gap is no longer than this, in seconds; in a longer gap the frame is not embedded and is counted as lost to heading.
Mirror hold¶
mirror_hold_s · number · default 1.0 · range 0–30 · unit s
mirror only: the animal must face the new way for this long, in seconds, before the image flips, so a heading hovering near straight-on does not flicker.
Facing-camera ratio¶
facing_camera_ratio · number · default 0.5 · range 0–1
A heading axis shorter than this fraction of the track's typical axis length (its 95th percentile over the run) is undefined: an animal facing the camera foreshortens its axis to noise, which is where headings flip.