/traffic

Primary LanguagePython

This is a traffic pipeline project code.

The correct code is stored in lifang535/traffic.

Mainly including VideoToFrame, ObjectDetection, LicenseRecognition, PersonRecognition, and FrameToVideo.

Image

Traffic Monitoring Pipeline

The modules are in traffic/module:

  • VideoToFrame: Extracts frames from video, and sends them to ObjectDetection.
  • ObjectDetection: Detects cars and persons, and sends them with boxes to LicenseRecognition and PersonRecognition respectively.
  • LicenseRecognition: Reads the text in the box of the frame, and sends frame with box and label to FrameToVideo.
  • PersonRecognition: Recognizes the face in the box of the frame, and sends frame with box and label to FrameToVideo.
  • FrameToVideo: Collects frames with boxes and labels, and combines them into a video.

Model Source

Quick Start

Download the input image and model from:

Install the required libraries:

$ pip3 install -r requirements.txt

Adjust configuration in traffic/module/configs.py.

Execute:

$ cd module
$ python3 pipeline.py

Then, the pipeline will read the videos from traffic/input_video, process them, and save the processed videos in traffic/output_video.

Docker

Search for the Docker image:

$ docker search traffic_monitoring_pipeline

Pull the image:

$ docker pull lifang535/traffic_monitoring_pipeline_with_git_v3

Create and run the container:

$ docker run --gpus all -it --rm --name temp traffic_monitoring_pipeline_with_git_v3

Execute the pipeline:

All dependencies have been installed. Execute the following commands:

$ cd module
$ python3 pipeline.py