Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLO-Object-Detection

🎯 Real-Time Object Detection using YOLOv9 and OpenCV

This project demonstrates real-time object detection using the YOLOv9 deep learning model integrated with OpenCV. It captures live video from a webcam, detects multiple objects using pre-trained YOLOv9 weights, and displays annotated frames in real-time with bounding boxes and labels. It also tracks the count of each detected object and saves it to a Python file.


🚀 Features

  • Real-time object detection using YOLOv9
  • Live webcam input with OpenCV
  • CUDA GPU acceleration support
  • Displays object labels and confidence scores
  • Tracks and logs object count in a Python dictionary

🛠️ Technologies Used

  • Python
  • OpenCV
  • PyTorch
  • Ultralytics YOLOv9
  • Collections (defaultdict)

🧾 Requirements

Install dependencies using pip:

pip install torch torchvision torchaudio opencv-python ultralytics

⚠️ Make sure your system supports CUDA if using GPU.


▶️ How to Run

  1. Clone this repository:
git clone https://github.com/your-username/YOLOv9-Object-Detection.git
cd YOLOv9-Object-Detection
  1. Place your yolov9c.pt weight file in the root directory.

  2. Run the detection script:

python detect.py

Press q to stop detection. The object counts will be saved to count.py.


🖼️ Demo

Demo Image

📁 Output File

After running, a file named count.py will be generated with a dictionary like:

object_counts = {
    'person': 5,
    'car': 2,
    'dog': 1,
}

👩‍💻 Author

Akanksha 📧 akankshaprashar5244@gmail.com


📜 License

This project is licensed under the MIT License.

About

A real-time object detection project using the YOLO (You Only Look Once) algorithm with Python and OpenCV. It detects multiple objects in images or video streams using pre-trained YOLO models with high accuracy and speed.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages