A Smart Online Voting System using facial recognition to authenticate users and ensure secure, fair voting. This project is developed using Python, OpenCV, Scikit-learn, and leverages the K-Nearest Neighbors (KNN) machine learning algorithm for face recognition. It also provides real-time visual statistical results such as bar charts and pie charts to display the ongoing election outcome.
- 🔐 Face Recognition Authentication using KNN algorithm.
- 🗳️ Secure Voting System – one person, one vote.
- 📊 Real-Time Statistical Results – includes pie charts, bar graphs, and vote percentages.
- 💾 Voter face data management and training set generation.
- 🧠 Uses Scikit-learn for KNN model training.
- 👁️ Built with OpenCV for image processing.
- Python 3
- OpenCV
- Scikit-learn
- Matplotlib / Seaborn (for plotting)
- NumPy
- Tkinter (optional for GUI)
Run face_capture.py to collect multiple facial images per voter.
Use train_model.py to train the KNN classifier using the collected dataset.
Run recognize_and_vote.py. The system matches the user's face with the trained model and allows them to vote once if verified.
Run result_display.py to generate bar graphs, pie charts, and vote statistics.
Make sure all dependencies are installed. You can run the main app (if app.py combines all phases or includes a GUI) using the following command:
python app.py
### 📦 Prerequisites
Make sure you have Python 3.x and pip installed.
```bash
pip install opencv-python scikit-learn numpy matplotlib