A real-time computer vision system that recognizes handwritten digits using a webcam feed. The system uses a Convolutional Neural Network (CNN) trained on the MNIST dataset to provide instant digit recognition.
- Real-time digit recognition through webcam
- CNN model trained on MNIST dataset
- Live confidence scores for predictions
- User-friendly visualization
- Mixed precision training for better performance
RealTimeDigitRecognizer/
├── data_loader.py # Handles MNIST dataset operations
├── model.py # CNN model architecture
├── camera_utils.py # Real-time video processing
├── main.py # Main application entry
└── requirements.txt # Project dependencies
- Python 3.10
- TensorFlow
- OpenCV
- NumPy
- scikit-learn
- Clone the repository:
git clone https://github.com/[YOUR_USERNAME]/RealTimeDigitRecognizer.git
cd RealTimeDigitRecognizer- Install dependencies:
pip install -r requirements.txt- Run the main application:
python main.py- A window will open showing your webcam feed
- Hold up a digit in the green rectangle
- The system will display:
- Recognized digit
- Confidence score
- Press 'q' to quit
The CNN model consists of:
- Input Layer (28x28x1)
- 2 Convolutional layers with MaxPooling
- Dense layer with dropout
- Output layer (10 classes)
- Training accuracy: >98% on MNIST
- Real-time inference
- Mixed precision training enabled
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- MNIST dataset for training data
- TensorFlow team for the deep learning framework
- OpenCV team for computer vision capabilities