Skip to content
body-tracking logo

Body Tracking Skill

body-tracking

Person detection, tracking, and Re-ID. Use when faces aren't visible but cast should still be tracked, or when debugging face-body association.

SKILL.md

Full skill instructions

Body Tracking Skill

Use this skill to debug body tracking and face-body association issues.

When to Use

  • Screen time gaps when cast is on screen but face not visible
  • Face-body association errors
  • Re-ID matching issues after occlusion
  • Debugging person detection coverage
  • Track fusion problems

Sub-agents

Sub-agentPurpose
PersonDetectorSubagentYOLO/​DETR person detection
PersonReIDSubagentOSNet/​Torchreid embeddings
TrackFusionSubagentFace-body association

Key Skills

Run body tracking pipeline

Run the sandbox pipeline on an episode (writes artifacts under data/​manifests/​{ep_id}/​body_tracking/).

from pathlib import Path

from FEATURES.body_tracking.src.body_tracking_runner import BodyTrackingRunner

runner = BodyTrackingRunner(
    episode_id="my-episode",
    config_path=Path("config/​pipeline/​body_detection.yaml"),
    fusion_config_path=Path("config/​pipeline/​track_fusion.yaml"),
)
runner.run_full_pipeline()

Fuse face ↔ body tracks

from FEATURES.body_tracking.src.track_fusion import TrackFusion

fusion = TrackFusion()
identities = fusion.fuse_tracks(face_tracks=face_tracks, body_tracks=body_tracks)

Compute body-only screentime deltas

python -m FEATURES.body_tracking --episode-id <EP_ID> --stage compare

Config Reference

File: config/​pipeline/​body_detection.yaml

KeyDefaultDescription
body_tracking.enabledtrueEnable body tracking
person_detection.modelyolov8nDetector model
person_detection.confidence_threshold0.50Detection confidence
person_tracking.track_buffer120Frames to keep lost tracks
person_reid.enabledtrueEnable Re-ID embeddings
person_reid.modelosnet_x1_0Re-ID model

File: config/​pipeline/​track_fusion.yaml

KeyDefaultDescription
track_fusion.enabledtrueEnable fusion stage
iou_association.iou_threshold0.50Face-in-body IoU threshold
reid_handoff.similarity_threshold0.70Re-ID match threshold
reid_handoff.handoff.max_gap_seconds30Max time for handoff
reid_handoff.handoff.confidence_decay_rate0.95Per-second decay

Common Issues

Missing body detections

Cause: Person not detected by YOLO

Check: Detection confidence in logs

Fix: Lower confidence threshold:

person_detection:
  confidence_threshold: 0.40  # default is 0.50

Wrong face-body association

Cause: IoU too loose or multiple people close together

Check: association_confidence in track metadata

Fix: Increase IoU threshold:

track_fusion:
  association_iou_thresh: 0.60  # default is 0.50

Re-ID fails after occlusion

Cause: Clothing change or long gap

Check: reid_similarity between pre/​post occlusion

Fix: Lower Re-ID threshold or increase gap tolerance:

track_fusion:
  reid_similarity_thresh: 0.60  # default is 0.70
  handoff:
    max_gap_seconds: 45  # default is 30

Body track ID switches

Cause: Tracker losing track through occlusion

Check: body_id_switch_rate in metrics

Fix: Increase track buffer:

person_tracking:
  track_buffer: 150  # default is 120 (5 seconds)

Diagnostic Output

{
  "identity_id": "ID_001",
  "face_track_ids": [42, 256],
  "body_track_ids": [100127, 100345],
  "screen_time": {
    "face_visible_duration": 125.5,
    "body_only_duration": 45.2,
    "total_duration": 170.7
  },
  "associations": [
    {
      "face_track": 42,
      "body_track": 100127,
      "method": "iou",
      "confidence": 0.85
    },
    {
      "face_track": null,
      "body_track": 100127,
      "method": "reid_handoff",
      "confidence": 0.72
    }
  ]
}

Key Files

FilePurpose
FEATURES/​body_tracking/​src/​detect_bodies.pyYOLO person detection
FEATURES/​body_tracking/​src/​track_bodies.pyBody tracking (ByteTrack + fallback)
FEATURES/​body_tracking/​src/​body_embeddings.pyOSNet Re-ID embeddings
FEATURES/​body_tracking/​src/​track_fusion.pyFace↔body fusion
FEATURES/​body_tracking/​src/​screentime_compare.pyScreentime comparison
config/​pipeline/​body_detection.yamlDetection config
config/​pipeline/​track_fusion.yamlFusion config

Related Skills

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View