This project is a face recognition web application that allows users to register their face using a webcam or uploaded image and later verify their identity using the same methods. The backend is built with FastAPI, while the frontend is powered by React and Tailwind CSS.
- User Registration: Users can register by capturing a live photo from their webcam or uploading an image file.
- Identity Verification: Users can verify their identity using a webcam or uploaded image.
- Face Recognition: The backend uses the FaceNet model for generating embeddings and comparing facial features.
- In-Memory Storage: User embeddings are stored temporarily in memory.
- React: A JavaScript library for building user interfaces.
- Tailwind CSS: A utility-first CSS framework for styling.
- Webcam.js: A library for accessing webcam streams.
- FastAPI: A modern, fast (high-performance) web framework for building APIs.
- FaceNet: A face recognition model for extracting facial embeddings.
- Python Libraries:
keras_facenetfor using FaceNet.numpyandopencv-pythonfor image processing.Pillowfor handling image files.
- Python 3.9+
- FastAPI
- Uvicorn
- keras-facenet
- numpy
- opencv-python
- Pillow
- python-multipart
- Node.js 16+
- npm or yarn
-
Clone the repository:
git clone https://github.com/Kitessafikadu/Revece.git cd Revece/backend -
Create a virtual environment and activate it:
python -m venv env source env/bin/activate # On Windows: .\env\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the backend server:
uvicorn main:app --reload
The backend will be accessible at http://127.0.0.1:8000.
-
Navigate to the
frontenddirectory:cd ../frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will be accessible at http://127.0.0.1:5173.
-
Homepage: The homepage greets users and provides navigation to the registration and verification pages.
-
Registration:
- Use the dropdown to select either
Upload ImageorUse Webcam. - Enter your name and upload a photo or take a live shot using your webcam.
- Click the
Registerbutton to save your data.
- Use the dropdown to select either
-
Verification:
- Use the dropdown to select either
Upload ImageorUse Webcam. - Upload a photo or take a live shot using your webcam.
- Click the
Verifybutton to verify your identity.
- Use the dropdown to select either
backend/
├── main.py # Main FastAPI application
├── requirements.txt # Python dependencies
└── user_images/ # Directory to store user images temporarily
frontend/
├── src/
│ ├── components/ # React components
│ ├── assets/ # Static assets like images
│ └── App.jsx # Main application component
├── public/ # Public static files
└── package.json # npm configuration
``