Skip to content

AbhayVAshokan/Object-Detection-YOLOv3

 
 

Repository files navigation

Object Detection using YOLOv3

A website to provide an interface for object detection algorithm using YOLOv3.

  • The input video is first checked for motion detection. If motion is detected, every second frame is processed using YOLOv3 object detection algorithm loaded with pre-trained weights. The processed video is stored in the path specified.

  • Start button sends an API request to the NodeJS server which opens a virtual python shell and runs the python code corresponding to the object detection.

  • Stop button send another API request to force stop the running python shell.

  • The Object detection algorithm loads videos/cctv_footage.mp4 and yolo-coco/yolov3.weights and writes to output/Test.avi by default unless specified otherwise. In addition, confidence value and threshold value can also be specified which are kept at 0 by default.

Screenshot

Setup

  1. The link contains the pretrained weights executing the YOLOv3 object detection algorithm: pre-trained weights

    Download the file and copy it into your yolo-coco folder.


  1. Install the following dependencies
    apt-get install nodejs
    apt-get install npm
    pip3 install opencv-python
    

  1. Install the npm dependencies.
    npm install
    

  1. Run the NodeJS server.
    node app
    

The website is available at localhost:3000.

Python Implementation (without UI) In order to run object detection algorithm without user interface execute the following command.

python3 detect.py

The following command gives more control over the parameters.

python3 detect.py --input videos/cctv_.mp4 --output outputs/Test.avi --yolo yolo-coco/yolov3.weights --confidence 0 --threshold 0

Generated folders

frames: Stores frame numbers of images processed after motion detection.

snapshots: Stores images in which the detection is performed.

time: Stores the timestamps of frames in frames directory.

output: Stores the output video with detection performed.

Important notes

  1. The project has been tested and developed on Chrome browser. We cannot guarantee that it works in other browsers as well.

  2. The API request times out in exactly 2 minutes. If the python code executes more more than 2 minutes on a video, it cannot generate a response. Use short videos and test using the python code directly if running time exceeds 2 minutes.

Releases

No releases published

Packages

No packages published

Languages

  • Python 57.7%
  • HTML 26.3%
  • JavaScript 16.0%