gait-lab-dataset
Query and analyze clinical gait lab (marker-based motion capture) data. Use when asked about c3d files, gait lab sessions, mocap markers, MocapProjection synchronization, video-mocap temporal alignment, GaitLab-MMC trial matching, gait events, gait parameters, forceplate/EMG analog data, or comparing marker-based and markerless motion capture systems.
What this skill does
# GaitLab Dataset Reference
## Overview
The `gait_lab` schema stores traditional clinical gait lab data from Vicon c3d files. This is a **separate system** from the markerless multicamera (MMC) pipeline. The same participant may have data in both systems, recorded during the same session (MAC_LAB participants).
**Source:** `GaitLabDataset/gait_lab_dataset/`
**Schema name:** `gait_lab`
---
## Table Hierarchy
```
Subject (subject_hash)
-> Session (subject_hash, session_name)
-> Trial (subject_hash, session_name, trial_name)
| -> Mocap (point_names, points in mm, point_rate, timestamps)
| | -> GaitEvents (event, side, time)
| | -> GaitParameters (parameter, side, value)
| | -> MocapAnalysis (property, value)
| | -> MocapProjection (toffset, camera params, error, proj, frames)
| -> GaitTrialVideo -> pose_pipeline.Video
| -> Analog (analog_names, channels, timestamps, units)
-> PTEval (eval_html) -> PTDemographics (age, diagnosis)
-> Assessment (assessment)
-> Height (computed, meters)
-> Weight (computed, kg)
-> SessionConditions -> SessionCondition + ConditionTrial
-> MPParam (property, value, all_values)
-> SubjectTrainTest (train boolean)
```
---
## Table Definitions
### Core Tables
**Subject** - De-identified subject identifier
```python
subject_hash: varchar(100) # Primary key
```
**Session** - Clinical session grouping
```python
-> Subject
session_name: varchar(100)
```
**Trial** - Individual gait trial
```python
-> Session
trial_name: varchar(100)
---
timestamp: timestamp # When the trial was recorded
description: varchar(1000) # Free-text (e.g., "Barefoot with cane", "Right AFO")
vid_present: boolean # Whether video was recorded
mocap_present: boolean # Whether c3d mocap data exists
```
### Motion Capture Data
**Mocap** - 3D marker data from c3d files
```python
-> Trial
---
point_names: longblob # List of marker names (e.g., ["SACR", "LASI", "RASI", ...])
points: longblob # Shape: [n_frames, n_markers, 5]
# Channels: [x, y, z, residual, visibility]
# Units: MILLIMETERS
# Visibility: 0 = valid, non-zero = occluded
point_rate: float # Sampling rate, typically 100 Hz
frames: longblob # Frame indices
timestamps: longblob # Computed as frames / point_rate (seconds)
```
**Analog** - Force plate and EMG data
```python
-> Trial
---
analog_names: longblob # Channel labels (e.g., forceplate channels, EMG channels)
channels: longblob # Shape: [n_channels, n_samples] (transposed)
timestamps: longblob # Synced to mocap: mocap_start + arange(n_samples) / analog_rate
units: longblob # Physical units per channel (e.g., "N", "V")
```
Analog data is synchronized to mocap via a shared trigger pulse. Timestamps are computed relative to the mocap frame start time.
**GaitEvents** - Annotated gait events from Vicon processing
```python
-> Mocap
event_num: smallint
---
event: varchar(100) # e.g., "The instant the heel strikes the ground"
side: enum('Left', 'Right')
time: float # Event time in seconds relative to mocap timestamps
```
**GaitParameters** - Pre-computed clinical gait parameters
```python
-> Mocap
parameter: varchar(50) # e.g., stride length, cadence
side: enum('Left', 'Right')
---
value: float
```
### Video Linkage
**GaitTrialVideo** - Links gait trials to the pose pipeline's Video table
```python
-> Trial
-> Video # from pose_pipeline (video_project, filename)
```
### Session Metadata
**SessionConditions** (Computed) - Parsed trial conditions from descriptions
```python
-> Session
---
num_conditions: smallint # Number of distinct gait conditions tested
```
Part table **SessionCondition**:
```python
-> SessionConditions
support: varchar(50) # "none", "cane", "walker", "gait_trainer", "handheld", "crutch"
left_foot: varchar(50) # "barefoot", "afo", "smo", "kafos", "brace", "ucb", "insert"
right_foot: varchar(50) # Same options as left_foot
shoe: varchar(50) # Whether shoes were worn
---
num_mocap: smallint # Trials with synchronized mocap
num_frontal: smallint # Frontal-view-only video trials
num_sagital: smallint # Sagittal-view-only video trials
```
Part table **ConditionTrial**:
```python
-> GaitTrialVideo
-> SessionConditions.SessionCondition
---
view: smallint # 0=with mocap sync, 1=frontal only, 2=sagittal only
```
**Height** (Computed) - Session-level height
```python
-> Session
---
height: float # Meters, from MocapAnalysis("HEIGHT") or MPParam("Height")
```
**Weight** (Computed) - Session-level weight
```python
-> Session
---
weight: float # kg, from MocapAnalysis("BODYMASS") or MPParam("Bodymass")
```
---
## MocapProjection: Video-Mocap Synchronization
The `MocapProjection` table synchronizes 3D mocap markers with 2D video keypoints, solving for both a temporal offset and camera projection parameters.
**Source:** `gait_lab_dataset/mocap_sync.py`
### Table Definition
```python
-> Mocap
-> GaitTrialVideo
-> TopDownPerson # 2D keypoints from pose detection
-> VideoInfo
---
toffset: float # Temporal offset (seconds) between mocap and video
fx, fy: float # Camera focal lengths (pixels)
cx, cy: float # Principal point (image center)
tx, ty, tz: float # 3D translation (mocap -> camera frame)
rx, ry, rz: float # Rotation (Rodrigues / exponential map, stored at 1/1000 scale)
error: float # Huber loss of final projection fit (lower = better)
proj: longblob # Projected mocap positions in 2D [n_frames, n_joints, 2]
frames: longblob # Video frame indices where projection was valid
```
### Synchronization Algorithm
The algorithm jointly optimizes temporal offset and camera parameters to align 3D mocap markers to 2D pose detections:
1. **Data extraction** (`get_dual_data()`):
- Fetches mocap 3D markers (hip, knee, ankle via Plug-In Gait bone model)
- Fetches 2D keypoints from TopDownPerson (COCO format)
- Filters to frames with high confidence 2D detections (>0.2) and valid mocap markers (visibility==0)
- Swaps Y/Z axes to align mocap vertical with image vertical
- Clips to temporal overlap with 200ms buffer at each end
2. **OpenCV initialization** (`cv2_calibrate()`):
- Uses `cv2.calibrateCamera()` with all points across time as one observation
- Fixes principal point at image center, fixes all distortion coefficients
- Initial focal length: ~1200 pixels
- Must achieve Huber loss < 12 (quality gate)
3. **JAX/BFGS optimization** (`optimize_projection()`):
- 9 parameters: `[tx, ty, tz, rx, ry, rz, fx, fy, toffset_raw]`
- Time offset bounded: `toffset = tanh(toffset_raw) * 0.2` (max +/- 200ms)
- Mocap is interpolated at `timestamps + toffset` for each candidate offset
- Loss: Huber loss between detected 2D keypoints and projected 3D markers
- Uses `jax.scipy.optimize.minimize(method="BFGS", maxiter=1000)`
- Projection uses `SO3.exp(rvec)` for rotation (jaxlie)
4. **Storage**: Optimized parameters stored in MocapProjection table. Note `rx, ry, rz` are stored at **1/1000 scale** (divided by 1000 before insert).
### Marker Mapping (Mocap <-> COCO)
The synchronization maps Plug-In Gait bone markers to COCO keypoints:
| COCO Keypoint | Plug-In Gait Marker | Description |
|---------------|---------------------|-------------|
| Right Hip | RFEP | Right Femur Proximal |
| Right Knee | RFEO | Right Femur Origin |
| Right Ankle | RTIO | Right Tibia Origin |
| Left Hip | LFEP | Left Femur Proximal |
| Left Knee | LFEO | Left Femur Origin |
| Left Ankle | LTIO | Left Tibia Origin |
### Data Statistics
- ~8,568 successRelated in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.