This directory contains various implementation examples for the Face Looker project.
The simplest way to implement face tracking in your React app.
Features:
- Basic FaceTracker component usage
- Debug mode demonstration
- Responsive design
- Touch support
Files:
App.jsx- Main application componentApp.css- Styling
TypeScript version with full type safety.
Features:
- Full TypeScript types
- Type-safe props
- Better IDE autocomplete
- Production-ready code
Optimized for Next.js with server-side rendering considerations.
Features:
- Next.js Image optimization (optional)
- SSR-safe implementation
- App Router compatible
- Dynamic imports
Example showing multiple face trackers on one page.
Features:
- Multiple independent face trackers
- Different configurations
- Performance optimization
Advanced styling examples.
Features:
- Circular masks
- Border effects
- Animations
- Hover effects
- Generate your faces first:
cd ../
python main.py --image ./my_face.jpg --out ./out- Copy faces to your React project:
cp -r ./out/faces /path/to/your-react-app/public/- Copy the example you want:
# For basic React
cp examples/react-basic/* /path/to/your-react-app/src/
# For TypeScript
cp examples/typescript/* /path/to/your-react-app/src/- Install dependencies (if needed):
npm install
# or
yarn install- Start with
react-basicif you're new to the project - Use
typescriptfor production applications - Check
custom-stylingfor inspiration on making it unique multiple-facesshows how to handle multiple instances
All examples assume:
- Face images in
/public/faces/ - Default grid parameters (
-15to15, step3) - 256×256 image size
If you changed generation parameters, update the constants in useGazeTracking.js.
See the main README.md for full documentation.