Welcome to the YOLOv8 Object Detector project! This application utilizes YOLOv8 for real-time object detection with a user-friendly GUI built using Tkinter.
- Real-Time Object Detection: Capture video feed from your webcam and detect objects in real time.
- Customizable Settings: Easily adjust model parameters, confidence thresholds, frame rate, and bounding box color.
- Capture Still Images: Take snapshots of the detected objects.
Follow these steps to set up the project on your local machine:
-
Clone the Repository
git clone https://github.com/yourusername/YOLOv8-Object-Detector.git cd YOLOv8-Object-Detector -
Install Dependencies
Ensure you have Python installed, then run:
pip install -r requirements.txt
-
Download YOLOv8 Models
Download the YOLOv8 models you wish to use (e.g.,
yolov8n.pt,yolov8s.pt,yolov8m.pt) from the official YOLOv8 GitHub repository.
-
Run the Application
python object_detector.py
-
Interact with the GUI
- Capture Still Image: Click the "Capture Still Image" button to take a snapshot.
- Configuration: Click the "Configuration" button to open the settings window where you can adjust:
- Model
- Confidence Threshold
- Frame Rate
- Box Color
- Quit: Click the "Quit" button to exit the application.
Configuration settings are stored in a config.json file. You can manually edit this file or use the in-app configuration window to adjust settings. Here is an example of the config.json file:
{
"model": "yolov8n.pt",
"confidence_threshold": 0.5,
"fps": 30,
"box_color": "#00FF00"
}object_detector.py: Main script that initializes the GUI and handles the detection logic.config_window.py: Contains theConfigWindowclass for the configuration GUI.requirements.txt: List of Python dependencies.
- OpenCV: For video capture and image processing.
- Torch: Deep learning framework.
- Ultralytics YOLO: Pretrained YOLO models.
- Tkinter: GUI framework.
- Pillow: Image handling.
Contributions are welcome! Feel free to submit a pull request or open an issue.
This project is licensed under the MIT License. See the LICENSE file for details.