Quickstart¶
Input you need¶
- A video of one or more circular arenas filmed from above (
.avi,.mp4,.mov,.mkv). -
A timing CSV describing each frame's time. By default
anytracklooks for<video>.csvnext to the video. It must contain aframecolumn plus either:dt_s— seconds elapsed since the previous frame, ortimestamp_s— absolute seconds.
Kinematics use these real intervals, so speeds are correct even with a variable frame rate.
Track one video¶
This detects arenas, models backgrounds, tracks each fly, and writes
localsearch_2026-05-28_tracks.parquet next to the video (see
Output formats).
Point --timing at a differently-named CSV, and --output at a file or directory:
Preflight first (recommended)¶
Validate inputs and print the effective config + run plan without decoding anything:
Or validate inputs on their own (exits non-zero on any bad file):
anytrack validate --video /data/expt/ # a whole folder
anytrack validate --video clip.avi --deep # also decode the last frame
Process a whole folder¶
Passing a directory to --video runs every video in it. Control how many run at
once with --concurrency:
Add a QC report¶
This writes an overlay video, diagnostic plots, per-frame flags, and a bundled
qc_report.html. See QC report.
Odor-port detection (on by default)¶
Every run detects the central odor-delivery port per arena and adds fly→port
distance columns (dist_to_port_*), plus the port in <stem>_rois.json and a
<stem>_ports.png overlay. Disable it with port_detect_enabled=false in your
config; --detect-port forces it on for a single run.
Run only the background/port stage (no tracking) to check port placement:
Speed vs. accuracy knobs¶
# downscale arenas 4×, track every 2nd frame (interpolate the rest), 6 workers
anytrack run --video clip.avi --downscale 4 --stride 2 --workers 6
See Configuration for what these do and their defaults.
Common recipes¶
| Goal | Command |
|---|---|
| One video, defaults | anytrack run --video clip.avi |
| Folder, 3 at a time, with QC | anytrack run --video /data/ --concurrency 3 --qc |
| Inputs check only | anytrack run --video /data/ --dry-run |
| Backgrounds + ports only | anytrack run --video /data/ --bg-only |
| One arena only | anytrack run --video clip.avi --roi arena_02 |
| Export centroid crops | anytrack run --video clip.avi --crops |