Skip to content

ash3327/ObjectDetection-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ObjectDetection-v1

Python Ultralytics YOLO Artificial Intelligence (AI) Object Detection Last Updated

Backup of Old Project (June 2023)

This is a backup of an old project that focused on object detection and tracking over videos using YOLOv8. The project was based on the following tutorials:

The project was written in Python and uses the YOLOv8 object detection model.

Execution

Start a new virtual environment:

python3 -m venv venv
source venv/bin/activate # linux or windows WSL
.\venv\Scripts\activate # windows cmd

Then install the requirements:

pip install -r requirements.txt

Finally, run the jupyter notebook Object Detection.ipynb within the virtual environment.

About the Project / Key Features

Static Image Detection Section 3.2

  • Applying YOLOv8 on static image given by path specified in the "Parameters" section.

alt text

Video Detection Section 3.4

  • Applying YOLOv8 on video given by path specified in the "Parameters" section.

alt text

Instance Tracking with Abrewlay Sort Section 3.5.1 Abrewlay Sort

  • Instance identification with Abrewlay Sort library for tracking objects.

alt text

Notes

  • The color of the box indicates the INSTANCE ID

Problems

  1. Inconsistent IDs: Occurs under occlusion or label changes
    • Observe that the id of the truck 457 on the rightmost lane (cyan, with label "car") changed to id 473 (purple, with label "truck")
    • Indicates that the library cannot provide a consistent ID for the same object across frames
  2. Multiple bounding boxes for the same object
    • As artifacts of the original YOLOv8 detection (due to using the nano model)

Custom Tracking Algorithm Section 3.5.2

  • Instance identification with custom-implemented algorithm for tracking objects.

alt text

Goals

  • Implementing a version of the object tracking algorithm that is more resistent to lost frames and flickering compared to the Abrewlay Sort library.

Features

  1. Label Accumulation
    • Can accumulate labels from previous frames.
    • The ids (colors of the frames) of the objects are more consistent, which can be checked visually
    • The same truck now got a consistent id (no change in color indicates that)
  2. Bounding Box Merging
    • Finds the closest bounding box to the previous frames (stored in a dictionary)
    • Dictionary is cleared after a certain number of frames
    • Only bounding boxes within a certain change in size and aspect ratio are merged by overwritting the same instance id

Car Counter Section 3.6

alt text

  • Simple algorithm for counting cars across the line by masking the image before detection.
  • Utilized the algorithm in sectino 3.5.2 for tracking objects to ensure that a car is not detected twice.

About

Performed object detection and tracking on videos using **YOLOv8**

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published