๐ฌ Annotation Tool Overview
Professional Video Annotation for Tennis AI Training
AceSense Annotate is a cross-platform desktop application for creating high-quality training data for tennis AI models. Built with Tauri + React for native performance.
๐ฏ Purposeโ
:::info Why This Exists
- Training Data: Create labeled datasets for shot detection and event classification (point, box, and temporal-event annotations)
- Speed: Professional annotators need keyboard-first workflows :::
๐ ๏ธ Tech Stackโ
| Technology | Version | Purpose |
|---|---|---|
| ๐ฆ Tauri | 2.0+ | Desktop shell (frameless window, fs/dialog/opener plugins). No decoding/persistence logic lives in Rust. |
| โ๏ธ React | 18.3 | UI framework โ owns video, canvas overlay, annotation state, persistence |
| โก Vite | 6.4 | Build tool |
| ๐ TypeScript | 5.6 | Type safety |
| ๐ฌ @ffmpeg/ffmpeg | 0.12 | Client-side WASM format conversion (MP4 fallback when a video won't play) โ not Rust decoding |
| ๐ PostHog | โ | Product analytics |
๐๏ธ Architectureโ
The Rust backend (
src-tauri/src/lib.rs) only wires the shell: frameless window setup plus fs/dialog/opener plugins. Video playback, the Canvas2D annotation overlay, WASM format conversion, and project persistence (via@tauri-apps/plugin-fs) all run in the React frontend. The app also runs in a plain browser (web mode) with a file-picker fallback.
๐ Project Structureโ
acesense-annotate/
โโโ src/ # React frontend
โ โโโ App.tsx # Main workspace
โ โโโ components/
โ โ โโโ VideoViewport.tsx # <video> + Canvas2D annotation overlay
โ โ โโโ Timeline.tsx # Frame scrubber
โ โ โโโ PropertiesPanel.tsx # Property editor
โ โ โโโ ItemsPanel.tsx # Annotation list
โ โ โโโ ContextModal.tsx # Tennis context picker
โ โ โโโ ShortcutModal.tsx # In-app shortcut cheat sheet (`?`)
โ โ โโโ ErrorBoundary.tsx # Crash guard
โ โ โโโ VideoConverter.tsx # @ffmpeg/ffmpeg WASM converter
โ โโโ types.ts # TypeScript types (Tool, Annotation, TemporalEvent, ProjectData)
โ โโโ utils.ts # Helpers (allowed-events, fps detection)
โโโ src-tauri/ # Tauri shell
โ โโโ src/lib.rs # Plugin registration + frameless window setup
โ โโโ Cargo.toml # Dependencies
โ โโโ tauri.conf.json # App config
โโโ public/ # Static assets
โโโ package.json
๐ฎ Keyboard Shortcutsโ
Playback Controlsโ
| Key | Action |
|---|---|
Space | Play / Pause |
โ / โ | Frame step |
Shift + โ / โ | Jump 10 frames |
J / K / L | Reverse / Pause / Forward (J/L ramp 2รโ4ร on repeat) |
Annotation Toolsโ
| Key | Tool | Behavior |
|---|---|---|
P | Point | Click to place a point (x, y, time) |
B | Box | Click-drag to draw (x1, y1, x2, y2, time) |
T | Temporal Event | Activate event tool, or close the open event |
1โ6 | Set event type | serve / shot / bounce / point_end / net_hit / out (selected event) |
Esc | Select / deselect | Back to select tool |
? | Help | Toggle the shortcut cheat sheet |
See the full Keyboard Reference. There is no skeleton tool or ML-suggestion review.
๐พ Tennis Context Systemโ
Before annotating, select the tennis context to unlock appropriate tools:
| Context | Allowed Annotations |
|---|---|
| Match | serve, shot, bounce, net_hit, out, point_end |
| Practice | shot, bounce |
| Training (off-court) | shot only |
| Highlight clip | shot, point_end |
๐ Annotation Schemaโ
The persisted shapes come from src/types.ts. There is no pose/skeleton schema.
Temporal Eventโ
{
"id": "evt_014",
"type": "event",
"eventType": "shot",
"startTime": 12.21,
"endTime": 12.94,
"shotType": "forehand",
"confidence": 0.88
}
eventType โ serve | shot | bounce | net_hit | out | point_end. shotType (forehand | backhand | unknown) and confidence are optional. endTime is null while an event is open.
Point / Box annotationsโ
{ "id": "pt_001", "type": "point", "time": 3.417, "x": 0.51, "y": 0.18 }
{ "id": "box_002", "type": "box", "time": 4.000, "x1": 0.40, "y1": 0.30, "x2": 0.62, "y2": 0.70 }
The full saved file is a ProjectData object (video, fps, video_meta, events, annotations).
๐ Developmentโ
# Install dependencies
pnpm install
# Start dev server (web preview, runs in a plain browser too)
pnpm dev
# Run desktop app
pnpm tauri dev
# Type-check / test
pnpm typecheck
pnpm test
# Build production app
pnpm tauri build
๐ Relatedโ
- GPU Backend - Uses annotated data for training
- Frontend - Displays AI analysis results