GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - baileyarzate/WebcamObjectDetection: Code to do object recognition for webcams, built in or external

BranchesTags
Open more actions menu

Latest commit

 

History

44 Commits
44 Commits

Folders and files

NameName
Last commit message
Last commit date
RunObjectAnalyzer
RunObjectAnalyzer
 
 
StandaloneFiles
StandaloneFiles
 
 
annotations
annotations
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 

Repository files navigation

Object Detection using YOLOv8, YOLOv5, and Faster R-CNN

This repository contains scripts for performing object detection using the YOLOv5, YOLOv8, and Faster R-CNN models. The scripts are capable of detecting objects in real-time from live video streams captured by a webcam or an external camera.

YOLOv8 Object Detection

The Webcam Object Detection YOLOv8 (cpu).py script utilizes the YOLOv8 model for object detection. It connects to a webcam or an external camera and performs real-time object recognition. The script draws bounding boxes around detected objects along with labels indicating the type of object and its confidence score.

Requirements

  • Python 3.x
  • OpenCV (cv2)
  • NumPy (numpy)
  • PIL (Pillow)
  • Ultralytics YOLO (ultralytics)

Installation

  1. Install required Python packages:
pip install opencv-python numpy Pillow ultralytics
  1. Install the YOLO v8 model:
from ultralytics import YOLO
model = YOLO('yolov8n.pt')
  1. Usage
python Webcam Object Detection YOLOv8 (cpu).py

By default, the script will use the built-in webcam (camera index 0) for object detection. Press 'q' to exit the program.

Parameters

  • camera (int, optional): The camera index. Use 0 for the built-in webcam, or specify 1-n for other connected cameras. Default is 0.
  • threshold (float, optional): Confidence threshold for object detection (between 0 and 1). Default is 0.5.
  • font_size (int, optional): Font size for object labels. Default is 18.

YOLO v5 Object Detection

The Webcam Object Detection YOLOv5 (cpu).py script utilizes the YOLOv5 model for object detection. It connects to a webcam or an external camera and performs real-time object recognition. The script draws bounding boxes around detected objects along with labels indicating the type of object and its confidence score.

Requirements

  • Python 3.x
  • OpenCV (cv2)
  • NumPy (numpy)
  • Torch (torch)
  • Ultralytics YOLO (ultralytics)

Installation

  1. Install required Python packages:
pip install opencv-python numpy torch torchvision
  1. Install the YOLOv5 model:
import torch
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
  1. Usage
python Webcam Object Detection YOLOv5 (cpu).py

By default, the script will use the built-in webcam (camera index 0) for object detection. Press 'q' to exit the program.

Parameters

  • camera (int, optional): The camera index. Use 0 for the built-in webcam, or specify 1-n for other connected cameras. Default is 0.
  • threshold (float, optional): Confidence threshold for object detection (between 0 and 1). Default is 0.5.
  • font_size (int, optional): Font size for object labels. Default is 18.

Faster R-CNN Object Detection

The PyTorch Webcam Object Detection.py script utilizes the Faster R-CNN model for object detection. It connects to a webcam or an external camera and performs real-time object recognition. The script draws bounding boxes around detected objects along with labels indicating the type of object and its confidence score.

Requirements

  • Python 3.x
  • OpenCV (cv2)
  • NumPy (numpy)
  • TorchVision (torchvision)
  • PyCOCO Tools (pycocotools)
  1. Install required Python packages:
pip install opencv-python numpy torchvision pycocotools

By default, the script will use the built-in webcam (camera index 0) for object detection. Press 'q' to exit the program.

Acknowledgments

This project utilizes the Ultralytics YOLO library for YOLOv8 object detection and TorchVision for Faster R-CNN object detection. YOLO (You Only Look Once) and Faster R-CNN are state-of-the-art, real-time object detection systems that identify multiple objects in images or video streams.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Code to do object recognition for webcams, built in or external

Resources

Readme
License
Activity

Stars

0 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.