Git Product home page Git Product logo

jacob-pitsenberger / detecting-filtered-classes-with-yolov8-pretrained-model Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 7.7 MB

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.

License: MIT License

Python 100.00%

detecting-filtered-classes-with-yolov8-pretrained-model's Introduction

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 YOLO

Install dependencies using:

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:

# 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 repository

Example:

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:

# 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:

# 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.

detecting-filtered-classes-with-yolov8-pretrained-model's People

Contributors

jacob-pitsenberger avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.