DEV Community

Neil Ganguly
Neil Ganguly

Posted on AI-assisted

Touch Grass - Outdoor AI Fitness Coach

Touch Grass is a hands-free outdoor fitness coach that uses real-time computer vision to track body movement, count exercise repetitions, provide biomechanical feedback, and deliver voice coaching through a device camera.

Designed for outdoor workouts and park calisthenics, Touch Grass supports squats, push-ups, pull-ups, and jumping jacks. Instead of requiring users to constantly look at their phone, the application combines pose landmark detection, movement analysis, repetition tracking, and browser-based voice guidance so users can focus on exercising.

Key Architectural Pillars

Edge Vision: Hardware-accelerated MediaPipe Pose Landmarker provides 33 3D body landmarks directly in the browser. Touch Grass converts these landmarks into biomechanical measurements for squats, push-ups, pull-ups, and jumping jacks, using dual-threshold state machines with hysteresis for stable repetition counting.

Offline Voice Coaching: Browser-native speechSynthesis provides real-time audio cues without requiring a cloud TTS round trip. A priority-based speech queue cancels stale feedback so coaching stays synchronized with rapid movements.

Outdoor-First UX: A high-contrast interface is designed for visibility at a distance, while Off-Screen Mode dims the display while keeping movement tracking and voice coaching active.

FastAPI + SQLite: The backend serves the application and provides REST endpoints for logging workouts and retrieving session history, with SQLite providing lightweight local persistence.

Automated Verification: Pytest validates the backend and database layer, while Playwright uses mocked camera streams to verify page rendering, camera initialization, speech readiness, and interactive controls.

Computer Vision: Touch Grass uses MediaPipe Pose Landmarker as its real-time vision engine. Camera frames are processed directly in the browser to extract 33 body landmarks, which are then converted into joint angles, distances, and movement states for exercise recognition. We intentionally kept the pipeline lightweight rather than introducing an additional OpenCV processing layer.

Top comments (0)