A real-time facial recognition and analysis application built with TypeScript, React, and Next.js that utilizes FaceAPI for face detection, emotion recognition, and facial landmark tracking.
The application is deployed and accessible at: https://facial-recognition-app-bice.vercel.app/
- Real-time Face Detection: Detects faces using your webcam feed
- Emotion Recognition: Analyzes and displays emotions (happy, sad, angry, etc.)
- Facial Landmarks: Maps and displays key facial features
- Image Upload Analysis: Upload images to analyze faces in photos
- Responsive Design: Works across various devices and screen sizes
- User Controls: Pause video, toggle emotion display, toggle facial landmarks
- Frontend Framework: React with Next.js
- Language: TypeScript
- Face Detection: face-api.js
- Styling: CSS/SCSS
- Deployment: Vercel
- Node.js (version 14.x or higher recommended)
- npm or yarn package manager
-
Clone the repository:
git clone https://github.com/laurenp-2/facial-recognition-app.git cd facial-recognition-app -
Install dependencies:
npm install # or yarn install -
Start the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser to see the application.
- Allow Camera Access: When prompted, allow the application to access your camera.
- Wait for Models: The application will load facial recognition models (this might take a moment).
- Use Controls:
- Click "Pause Video" to freeze the current frame
- Toggle "Show Emotions" to display emotion recognition
- Toggle "Show Landmarks" to display facial feature points
- Use "Upload Image" to analyze faces in static images
facial-recognition-app/
├── app/ # Next.js app directory
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ ├── utils/ # Utility functions
│ └── page.tsx # Main page component
├── public/ # Static assets and face-api models
├── styles/ # Global styles
├── next.config.js # Next.js configuration
└── tsconfig.json # TypeScript configuration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- face-api.js for the facial recognition technology
- Next.js for the React framework
- Vercel for hosting the application
Created by Lauren
