GithubHelp home page GithubHelp logo

surveillance_yolo's Introduction

Surveillance YOLO

This Python project utilizes the YOLOv8 object detection model to detect people entering and leaving a camera's field of view. It logs the events and determines whether a person is on side A or side B of the frame.

Prerequisites

Ensure the following are installed on your system:

  • Python 3.x
  • PyTorch
  • NumPy
  • OpenCV
  • Ultralytics YOLO

Installation

Clone the repository

git clone https://github.com/Jyublee/Surveillance_Yolo.git

Install the Prerequisites

pip install -r requirements.txt

Usage

  • The program will start capturing video from the default camera (index 0) and perform person detection and logging during the specified time frame (current set to 9:00 AM to 1:00 PM).

  • The program will display the video feed with bounding boxes around detected people and their assigned IDs.

  • The program will log events in the logs.txt file whenever a person enters or leaves the frame, along with the timestamp and the side (A or B) they entered or left from.

  • The program will start recording video when a person is detected and stop recording after a specified delay (recording_stop_delay) when no person is detected.

  • The recorded videos will be saved in the recordings directory with a timestamp in the filename.

  • A blinking red circle and "Recording" text will be displayed on the video feed when recording is in progress.

  • Press 'esc' to stop the program.

Configuration

  • capture_index: The index of the camera to capture video from (default is 0).
  • log_delay: The delay in seconds between consecutive log entries for the same person (default is 2.0 seconds).
  • presence_threshold: The number of frames a person needs to be present to be considered as entered (default is 10 frames).
  • absence_threshold: The number of frames a person needs to be absent to be considered as left (default is 5 frames).
  • iou_threshold: The Intersection over Union (IoU) threshold for Non-Maximum Suppression (NMS) (default is 0.5).

TODO

  • Modify the Delay to give accurate logs
  • Add Function to Save the footage as photos or videos when detection occurs
  • Add potential Frontend and UI

License

This project is licensed under the MIT License.

surveillance_yolo's People

Contributors

jyublee avatar arjunraj11 avatar insertyourusernamehere avatar

Watchers

 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.