This project, created by Jr Santiago Ravelo, uses Flask and OpenCV to detect colors in real-time through the webcam. The software detects various colors in a video stream and draws rectangles around the detected objects, labeling them with their corresponding color.
- 'main' : English
- 'spanish' : Spanish
- Python 3.x
- Flask
- OpenCV
- NumPy
-
Clone the repository:
git clone https://github.com/JunniorRavelo/color-detector.git cd color-detector
-
Create a virtual environment:
python -m venv env_colors
-
Activate the virtual environment:
- On Windows:
.\env_colors\Scripts\activate
- On macOS and Linux:
source env_colors/bin/activate
- On Windows:
-
Install the dependencies:
Make sure you have a
requirements.txt
file with the following dependencies:blinker==1.8.2 click==8.1.7 colorama==0.4.6 Flask==3.0.3 itsdangerous==2.2.0 Jinja2==3.1.4 MarkupSafe==2.1.5 numpy==1.26.4 opencv-python==4.10.0.82 Werkzeug==3.0.3
Then, install the dependencies:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Open your web browser and go to
http://0.0.0.0:5000
to see the real-time color detection.
For the desktop version, it's located in desktop\desktop.py, which does not use Flask.