This project uses CNN to recognize and classify images captured from a webcam. The project includes training the model using images and testing the model using live webcam feed.
Make sure you have Python installed on your system. You will also need to install the following packages:
- TensorFlow
- OpenCV
- NumPy
- Matplotlib
- Scikit-learn
- Clone the repository to your local machine.
- Navigate to the project directory.
git clone https://github.com/tchan24/numberdetect
cd numberdetect
- Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
- Install the required packages
pip install tensorflow opencv-python-headless numpy matplotlib scikit-learn
- Prepare your dataset. Ensure that your dataset is organized into subdirectories where each subdirectory represents a class and contains images for that class.
- Update the path variable in the OCR_CNN_Training.py script to point to your dataset directory.
- Run the training script.
python OCR_CNN_Training.py
- Connect a webcam to your computer.
- Run the testing script.
python OCR_CNN_Testing.py