How harshita-8605/spatial-lens works
Spatial Lens is a real-time webcam AR effect with two implementations: a Python desktop app and a static browser experience. In the desktop workflow, the app loop reads frames, obtains portal corners from hand tracking, then selects idle, portal compositing, or fullscreen stylization before display. The browser version captures camera video, tracks hands, and renders portal or fullscreen effects in a canvas. The README documents both implementations; the browser details are based on the sampled app.js and README, not unsampled HTML or styles.
Main entry points: app.js Browser frame loop and modes · main.py Frame and mode loop · perception.py Hand tracking and corners · anime_engine.py Anime stylization
Components 15
Desktop experience
- Frame and mode loop
main.py
Desktop processing
- Hand tracking and corners
perception.py - Anime stylization
anime_engine.py - Portal compositing
compositor.py
Browser experience
- Browser frame loop and modes
app.js
Browser processing
- Hand detection and corners
app.js - Canvas stylization
app.js - Portal clipping and border
app.js - Hand landmarker model
hand_landmarker.task
Other components
- User
- Webcam
- Display window
- Browser camera
- Browser canvas
index.html - Vercel Analytics
Connections 14
- User → Webcam: presents hands
README.md - Webcam → Frame and mode loop: provides frames
main.py - Frame and mode loop → Hand tracking and corners: gets corners
main.py - Frame and mode loop → Anime stylization: stylizes frames
main.py - Frame and mode loop → Portal compositing: composites portal
main.py - Frame and mode loop → Display window: shows result
README.md - User → Browser camera: allows camera
README.md - Browser camera → Browser frame loop and modes: provides video
app.js - Browser frame loop and modes → Hand landmarker model: loads model
app.js - Browser frame loop and modes → Hand detection and corners: detects hands
app.js - Browser frame loop and modes → Canvas stylization: stylizes frames
app.js - Browser frame loop and modes → Portal clipping and border: clips portal
app.js - Browser frame loop and modes → Browser canvas: draws output
app.js - Browser frame loop and modes → Vercel Analytics: sends analytics
app.js