This project demonstrates how to use the YOLO (You Only Look Once) object detection model with Flask and a camera to detect objects in real-time. The application captures an image from the camera, sends it to the Flask server, and uses the YOLO model to detect objects in the image. The server then returns the detected objects, and the application displays the results with bounding boxes and labels.
- Python 3.7 or later
- Flask
- Pillow
- PyTorch
- transformers
Change the directory to the project folder:
cd your_repository Create a virtual environment:
python -m venv venv Activate the virtual environment: For Windows:
venv\Scripts\activate For macOS and Linux:
source venv/bin/activate Install the required packages:
pip install -r requirements.txt Usage Run the Flask server:
python main.py
Click the "Capture Image" button to capture an image and detect objects using the YOLO model.
Model Credits This project uses the YOLO model from the HUSTVL organization on GitHub. The specific implementation is hustvl/yolos-tiny from the Hugging Face Model Hub. The YOLO model is based on the paper "You Only Look Once: Unified, Real-Time Object Detection" by Joseph Redmon et al.
License This project is licensed under the MIT License.