Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacob-pitsenberger/detecting-filtered-classes-with-yolov8-pretrained-model
This project utilizes a YOLOv8 pretrained model from Ultralytics to perform filtered object detection on images, videos, or real-time webcam feeds. The filtered detector focuses on specific classes of objects from the COCO dataset. The included classes can be easily customized to suit your application.
https://github.com/jacob-pitsenberger/detecting-filtered-classes-with-yolov8-pretrained-model
Last synced: about 2 months ago
JSON representation
This project utilizes a YOLOv8 pretrained model from Ultralytics to perform filtered object detection on images, videos, or real-time webcam feeds. The filtered detector focuses on specific classes of objects from the COCO dataset. The included classes can be easily customized to suit your application.
- Host: GitHub
- URL: https://github.com/jacob-pitsenberger/detecting-filtered-classes-with-yolov8-pretrained-model
- Owner: Jacob-Pitsenberger
- License: mit
- Created: 2023-12-05T20:49:11.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-06T16:57:29.000Z (about 1 year ago)
- Last Synced: 2023-12-06T17:44:42.110Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 7.52 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# YOLOv8 Filtered Object Detection
## Overview
This project utilizes a YOLOv8 pretrained model from Ultralytics to perform filtered object detection on images, videos, or real-time webcam feeds. The filtered detector focuses on specific classes of objects from the COCO dataset. The included classes can be easily customized to suit your application.
## Prerequisites
- Python 3.x
- OpenCV
- Numpy
- Ultralytics YOLOInstall dependencies using:
```bash
pip install opencv-python numpy
pip install 'git+https://github.com/ultralytics/yolov5.git'
```
## Usage
Create a custom filter_classes list in the main.py file to specify the classes you want to detect. You can refer to the COCO dataset for a complete list of classes.Example:
```bash
# Create a custom filter_classes list to include the classes you want to detect.
# You can refer to the COCO dataset for a complete list of classes: https://cocodataset.org/#explore
# Example classes: 'person', 'car'
filter_classes = ['person', 'car']
# More examples can be added: 'bird', 'dog', 'cat', 'bicycle', ...
```
Or utilize the defined lists used with the test files in this repositoryExample:
```bash
image_test_filters = ['car', 'truck']
video_test_filters = ['chair', 'couch', 'potted plant', 'dining table', 'tv']
realtime_test_filters = ['cow', 'person', 'bottle', 'backpack', 'spoon', 'knife']
```Initialize the FilteredDetector with the specified filter classes in the main.py file.
Example:
```bash
# Initialize the FilteredDetector with the specified filter classes
detector = FilteredDetector(filter_classes)
```Uncomment the desired method in the main function to detect objects over an image file, video file, or real-time webcam feed.
Example:
```bash
# Uncomment one of the following lines to choose the detection method
# detector.detect_over_image('test_files/img.png')
# detector.detect_over_video_file('test_files/cows.mp4')
# detector.detect_over_realtime_feed()
```Run the main.py file to see the filtered object detection in action.
## Notes
- This project uses a pretrained YOLOv8 model from Ultralytics, trained on the COCO dataset.- Customize the filter_classes list to include the specific classes you want to detect.
- Feel free to explore and expand the functionality based on your project requirements.
## Author
Jacob Pitsenberger
December 5, 2023## License
This software is licensed under the MIT License. By using this software, you agree to comply with the terms outlined in the license.