This project is a Face Recognition Voting System built with FastAPI, SQLAlchemy, OpenCV, and face_recognition. It allows secure and seamless voting using facial recognition technology. The project also integrates with Google Sheets for counting votes.
- Voter ID, username, and password registration.
- Face capture using a webcam and saved as a reference for future recognition.
- The system ensures each voter ID is unique and valid.
- Authenticate voters using their face.
- Voters must enter their Voter ID, password, and pass facial recognition to access the voting dashboard.
- Voters can cast their votes once, and the system updates the voter's status after voting.
- Tracks which party a voter has voted for.
- Admin can view the total vote count for each party.
- Vote counts are updated in Google Sheets for transparency and easy access.
- Admin login with credentials.
- Admin dashboard for managing voters and viewing vote counts.
- Admin can search, update, or delete voter details.
- FastAPI: Backend framework for building APIs.
- SQLAlchemy: ORM for handling database operations.
- OpenCV: For capturing images and performing face recognition.
- face_recognition: Library for comparing facial encodings.
- Google Sheets API: To store and display vote counts in real-time.
To run this project, you will need:
- Python 3.8+
- FastAPI
- SQLAlchemy
- OpenCV
- face_recognition
- Passlib (for password hashing)
- dotenv (for environment variables)
- gspread & oauth2client (for Google Sheets integration)
-
Clone the Repository:
git clone https://github.com/yourusername/face-recognition-voting-system.git cd face-recognition-voting-system
-
Install Required Packages::
pip install -r requirements.txt
-
Set Up Environment Variables:
ADMIN_USERNAME=your_admin_username ADMIN_PASSWORD=your_admin_password
-
Set Up Database:: Make sure you have the database configured. Adjust the database settings in the database.py file to match your setup.
-
Google Sheets Integration::
- Enable the Google Sheets API and create credentials.
- Save your credentials as credential.json in the root directory.
- Run the Application::
uvicorn main:app --reload