Skip to content

FastPose Studio Tutorial: End-to-End Pose Training, Inference, Processing & Reports

This step-by-step tutorial walks you through the entire Annolid FastPose v2.1 workflow inside the desktop GUI—from generating a sample mouse pose dataset, to training a lightweight model with live loss/RMSE curves, running 166+ FPS CPU inference with temporal tracking and skeleton video rendering, benchmarking against SLEAP, and exporting a shareable HTML5/SVG results report.

No external datasets or manual file preparation are needed: you can complete every step in under 3 minutes using FastPose Studio's built-in Generate Demo Dataset… generator.

64 frames · 8 keypoints Generated mouse dataset + empty negatives
1.00 MB INT8 ShuffleNetV2 ONNX (2.55× smaller than FP32)
166.6–182.6 FPS Pure Apple M2 CPU inference (P-core pinned)
1.48 px p50 · 0.928 AP50 1.000 Keypoint F1 · 0 tracking ID switches

Prerequisites & How to Open FastPose Studio

  1. Launch Annolid (annolid).
  2. Open FastPose Studio from any of three entry points:
  3. AI & Models → FastPose Studio (Train, Infer & Reports)…
  4. Analysis → FastPose Studio (Train, Infer & Reports)…
  5. Inside Pose Estimation Workbench (Ctrl+Shift+P), click the FastPose Studio… button in the top bar.

Hardware Detection Bar

The top bar displays your active hardware profile—for example Device: CPU | CPU: 4P/8T | ORT: CoreML/CPU | ONNX export: ready (or MPS / CUDA when a GPU is available). FastPose automatically pins ONNX CPU inference to Apple Silicon Performance cores and enables PyTorch channels_last layout on CPU.


Step 1: Generate a Ready-to-Train Demo Dataset

If you already have a labeled LabelMe folder, SLEAP (.slp/.h5), DeepLabCut (.csv/.h5), COCO JSON, or an .mp4 video with adjacent *_annotations.ndjson, you can select it directly in Data / Video.

To follow along with a clean synthetic dataset first:

  1. Stay on Tab 1: 1. Train Model.
  2. Click Generate Demo Dataset… in the Training Data Source box.
  3. Choose Single Mouse (48 frames, 256×256 + demo_clip.mp4) (or Multi-Mouse for 2 interacting mice) and pick any empty folder (e.g., /tmp/fastpose_tutorial_demo).

Annolid generates a realistic synthetic arena containing:

  • Per-frame .png images + LabelMe .json files with 8 anatomical keypoints (nose, left_ear, right_ear, neck, left_hip, right_hip, tail_base, tail_tip),
  • Empty negative frames (~8%) with negative_frame: true so the model learns to stay silent when no animal is present,
  • pose_schema.json defining keypoint order, skeleton edges, and left/right symmetry pairs, and
  • demo_clip.mp4, a ready-to-run video clip automatically wired into Tab 2 for inference.

Generated synthetic mouse pose dataset preview showing five annotated 8-keypoint frames and one empty negative frame Figure 1: Sample frames from the generated 64-frame synthetic mouse pose dataset (256×256), including curved postures with 8 anatomical keypoints and an empty negative frame (bottom-right) used for false-positive suppression.

Next, click Inspect Source. FastPose Studio scans the dataset and reports:

  • Total samples and negative frame count (64 samples (5 negative)),
  • Auto-detected mode (single or multi),
  • Keypoint list and native vs. recommended aspect-preserving input size, and
  • Orientation check (Free-roaming 360° vs. Tethered / side-view, automatically disabling vertical flips on side-view/tethered recordings).

Step 2: Choose a Hardware Preset & Train with Live Curves

In the Model & Training Configuration panel, pick a Quick Preset matching your lab hardware and assay:

Quick Preset Backbone & Size Best Use Case
Single Animal — Fastest CPU (ShuffleNetV2 + INT8) shufflenet_v2 (~0.5–0.6M, 1.0 MB INT8) Solitary open-field assays on laptops/CPUs (114–183 FPS pure CPU)
Multi-Animal — Peak Accuracy (ResNet-18, Auto Aspect) resnet18 (~3.3M, 3.3 MB INT8) 2+ interacting animals (O(1) single pass; MPS/CoreML or CPU INT8)
Insect / Tiny ROI — Ultra-Compact (MobileNetV3-Small FP32) mobilenet_v3_small (~0.3M, FP32) Tethered flies / small ROIs (80–101 FPS CPU FP32; keep INT8 OFF)
Offline Scratch — No Pretrained Weights (RepRes-nano) repres (~1.7–1.8M) Air-gapped lab computers without internet access

For this walkthrough:

  1. Select Single Animal — Fastest CPU (ShuffleNetV2 + INT8).
  2. Keep Input Size at 192x192, Epochs at 25, Batch Size at 8, and verify Export Fused ONNX FP32, Auto Static QDQ INT8 (CPU), and Run Post-Train Holdout Eval are checked.
  3. Click Start FastPose Training.
  4. Watch Live Loss Curves (Train / Val) and Validation RMSE (px) update smoothly at every epoch.
  5. You can click Cancel in the bottom bar at any time—training stops cleanly after the current step and still saves your best checkpoint (best.pt).

FastPose Studio Tab 1 showing source inspection, ShuffleNetV2 preset configuration, live converging train/val loss and validation RMSE curves, and completed ONNX FP32/INT8 training log Figure 2: Tab 1 (Train Model) after 25 epochs on the generated dataset (71.7 s). Training loss drops from 34.8 to 5.99, validation RMSE converges to 6.28 px, and FastPose automatically exports best.onnx (2.56 MB), calibrates best_int8.onnx (1.00 MB), and scores the holdout split (p50 = 1.27 px, AP50 = 0.868).

When training finishes, FastPose Studio automatically fills your new best_int8.onnx into Tab 2, best.pt into Tab 3, and the run directory into Tab 4. Click Use Model in Inference → (or Open Run Folder to inspect best.pt, best.onnx, best_int8.onnx, train_summary.json, and val_evaluation.json).


Step 3: Run High-Speed Inference, Tracking & Skeleton Video Rendering

Switch to Tab 2: 2. Inference & Tracking:

  1. Model Selection: Notice the Discovered Runs dropdown automatically lists your trained checkpoints (run_shufflenet_v2/best_int8.onnx [shufflenet_v2 · single · 192x192 · ONNX INT8]) and displays backbone, resolution, file size (1.00 MB), and validation RMSE.
  2. Input & Output Targets: Confirm demo_clip.mp4 is selected as Input Video / Folder and set an Output Directory (e.g., /tmp/fastpose_tutorial_demo/preds_video).
  3. Runtime & Downstream Outputs:
  4. Leave Backend on Auto (recommended) and ONNX Provider on CPU (P-core pinned) (or choose Apple CoreML / CUDA for heavier multi-animal ResNet-18 runs).
  5. Enable Hungarian Linking + One-Euro Smooth and Confidence-Weighted OE for smooth, lag-free tracks.
  6. Enable Write Streaming NDJSON (for instant Annolid canvas video playback), Write Tracking CSV, Render Labeled Video (.mp4), and Compute Kinematics Bundle.
  7. Click Run FastPose Inference.

When to Use Viterbi Heading (Solitary Only)

Keep Viterbi Heading (Solitary Only) OFF by default. Velocity-anchored 2-state Viterbi heading helps solitary forward-locomotion assays (like top-down open-field tests), whereas social interactions frequently contain backward retreats where velocity points opposite to nose direction.

FastPose Studio Tab 2 showing auto-discovered ShuffleNetV2 INT8 checkpoint, video input, P-core CPU runtime, temporal smoothing options, and 166.6 FPS output artifact log Figure 3: Tab 2 (Inference & Tracking) running the 1.00 MB INT8 ONNX model on demo_clip.mp4 at 166.6 FPS (6.00 ms/frame) on pure CPU, writing per-frame LabelMe JSONs, demo_clip_annotations.ndjson, demo_clip_tracking.csv, demo_clip_fastpose_labeled.mp4, and a kinematics/ folder.

Opening the rendered demo_clip_fastpose_labeled.mp4 (or clicking Load Predictions in Canvas to inspect frame-by-frame in Annolid's main window) confirms accurate 8-keypoint predictions on moving frames and clean zero-false-positive silence on empty background frames:

Rendered output video frames from demo_clip_fastpose_labeled.mp4 showing predicted colored 8-keypoint skeletons on positive frames and zero false positives on empty Frame 015 Figure 4: Frames extracted directly from the rendered demo_clip_fastpose_labeled.mp4 video. Positive frames display cleanly localized body-part keypoints and skeleton edges, while empty Frame 000015 triggers zero false-positive detections.


Step 4: Export/Quantize, Post-Process & Benchmark vs. SLEAP

Switch to Tab 3: 3. Export, Process & Benchmark whenever you want to optimize an existing .pt model, re-smooth saved pose outputs, or verify FastPose speed/accuracy against a SLEAP baseline:

  • Section A — Export Fused ONNX FP32 & Static QDQ INT8:
  • Select best.pt and point Calibration Video/Dir to demo_clip.mp4.
  • Check Quantize Static QDQ INT8 and Run CPU Speed Probe, then click Export & Quantize.
  • On our demo run, static QDQ INT8 shrinks the fused model from 2.56 MB → 1.00 MB (2.55× smaller) and lifts pure CPU speed from 110.7 FPS → 182.6 FPS (1.65× faster).
  • Section B — Post-Process Pose Predictions:
  • Re-run either Temporal Tracker + Confidence-Weighted One-Euro or Offline Filter (Savitzky-Golay / Median + Gap Interp) on any LabelMe, SLEAP, or DeepLabCut predictions without re-running model inference.
  • Section C — Head-to-Head Model Benchmark (FastPose vs. SLEAP):
  • Pick Synthetic Benchmark (single_mouse, multi_mouse, or all) or Real Video Temporal Split Benchmark, set frame/epoch budget, and click Run Benchmark.
  • The sortable table displays exact parameter count, model size, training seconds, b=1 / b=8 FPS, RMSE, OKS mAP, and AP50—and automatically wires benchmark_report.json into Tab 4!

FastPose Studio Tab 3 showing ONNX FP32/INT8 export controls, temporal post-processing options, and the populated FastPose vs. SLEAP benchmark comparison table Figure 5: Tab 3 (Export, Process & Benchmark) showing the 2.56 MB (110.7 FPS) → 1.00 MB (182.6 FPS) INT8 export probe, temporal post-processing log, and a live FastPose vs. SLEAP benchmark (2.2× faster training, 2.5× faster CPU inference, 1.000 Keypoint F1 vs. 0.000 at 16 epochs).


Step 5: Generate a Unified HTML5/SVG + Markdown + CSV Results Report

Switch to Tab 4: 4. Results & Reports to combine everything into a single lab-ready report bundle:

  1. Verify the auto-populated inputs:
  2. Trained Run Dir (train_summary.json + val_evaluation.json),
  3. Predictions Source & Ground Truth (Optional) (to compute per-keypoint RMSE, p50/p90/p95, OKS mAP, AP50, and L/R swaps),
  4. Tracking CSV (Optional) (for detection recall, centroid error, and ID switch count), and
  5. Benchmark JSON (Optional) (to embed the FastPose vs. SLEAP comparison chart).
  6. Keep Include Kinematics Bundle checked and click Generate HTML / MD / JSON / CSV Report.

FastPose Studio Tab 4 showing executive KPI summary strip and live rendered Markdown report preview Figure 6: Tab 4 (Results & Reports) displaying the high-contrast KPI banner (149.3 FPS, 1.48 px median error, 0.928 AP50) and live Markdown preview, with one-click Open HTML Report and Open Folder buttons.

Click Open HTML Report to open fastpose_report.html in any web browser—it is 100% self-contained (zero external CDNs or matplotlib dependencies) and includes interactive KPI cards and vector SVG charts:

Self-contained fastpose_report.html preview showing teal executive KPI cards, inline SVG training and validation loss curve, per-keypoint RMSE horizontal bar chart, and benchmark FPS comparison bar chart Figure 7: Rendered preview of fastpose_report.html, containing executive KPI cards, inline SVG Training & Validation Loss History, Per-Keypoint Euclidean RMSE (nose = 0.86 px, neck = 1.64 px, tail_tip = 2.56 px), and Benchmark Throughput Comparison.

Output Report Files Created

final_report/
  fastpose_report.html          # Self-contained shareable HTML5 + inline SVG report
  fastpose_report.md            # GitHub/MkDocs-ready Markdown summary
  fastpose_report.json          # Full structured metrics payload for downstream scripts
  per_keypoint_metrics.csv      # Per-keypoint matched count, recall, RMSE, p50/p90/p95
  pose_eval/                    # Detailed pose evaluation HTML/CSV/JSON + worst frames
  kinematics/                   # Per-keypoint speeds, bone lengths, angles & headings CSVs

Step 6: Moving to Your Own Real Lab Videos (GUI & CLI)

Once you have verified the workflow on the generated dataset, running on your own lab recordings takes the exact same steps:

  1. Direct Video + NDJSON / LabelMe Training: Point Tab 1 → Data / Video directly to your .mp4 video (with an adjacent *_annotations.ndjson or per-frame LabelMe .json folder). Keep Strict Temporal Split (Leak-Free) enabled with a 5% gap so validation measures genuine future-frame generalization.
  2. Close the Human-in-the-Loop Cycle: Click Open Pose Workbench… in the top-right header to run Label QC (catching L/R swaps or bone outliers) and Active Learning Outliers (sending high-uncertainty frames straight to Annolid's Frame Selection Queue for rapid relabeling).
  3. Headless / Batch CLI Equivalents: Every FastPose Studio step is reproducible from the command line:
# 1. Train FastPose v2.1 (e.g., multi-animal ResNet-18 on MPS or CUDA)
annolid-run train fast_pose \
  --data ./my_pose_dataset \
  --output ./runs/fastpose_r18 \
  --backbone resnet18 --pretrained \
  --input-size 224x384 --epochs 35 --batch 16 \
  --device auto

# 2. Run batched ONNX video inference with temporal tracking & smoothing
annolid-run predict fast_pose \
  --weights ./runs/fastpose_r18/best.onnx \
  --input ./trial_01.mp4 \
  --out ./preds/trial_01 \
  --backend onnx --temporal-smooth

# 3. Inspect all available flags at any time
annolid-run help train fast_pose
annolid-run help predict fast_pose

Quick Troubleshooting & Best Practices

  • Small datasets (~50–150 frames): Keep ImageNet Pretrained enabled (shufflenet_v2 for single animal, resnet18 for multi-animal) and train for 25–35 epochs so left/right ear and hip symmetry resolves cleanly.
  • MobileNetV3-Small quantization: Always deploy mobilenet_v3_small as ONNX FP32 on CPU (80–101 FPS); static QDQ INT8 degrades Squeeze-and-Excite / Hardswish activation ranges.
  • High-resolution multi-animal videos (1024×570+): Leave Input Size set to auto so FastPose preserves your arena's native aspect ratio (e.g. 224×384) instead of squashing into a square.
  • Further reading: See the Pose Estimation Workflow and the full technical paper (paper/annolid_fastpose/annolid_fastpose.md).