The correct code is stored in lifang535/traffic.
Mainly including VideoToFrame, ObjectDetection, LicenseRecognition, PersonRecognition, and FrameToVideo.
The modules are in traffic/module
:
VideoToFrame
: Extracts frames from video, and sends them toObjectDetection
.ObjectDetection
: Detects cars and persons, and sends them with boxes toLicenseRecognition
andPersonRecognition
respectively.LicenseRecognition
: Reads the text in the box of the frame, and sends frame with box and label toFrameToVideo
.PersonRecognition
: Recognizes the face in the box of the frame, and sends frame with box and label toFrameToVideo
.FrameToVideo
: Collects frames with boxes and labels, and combines them into a video.
ObjectDetection
: YOLOs TinyLicenseRecognition
: EasyOCRPersonRecognition
: Face Recognition
Download the input image and model from:
- input_image: EfficiencyAttack/input_image
- model: EfficiencyAttack/model
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 traffic_monitoring_pipeline
$ docker pull lifang535/traffic_monitoring_pipeline_with_git_v3
$ docker run --gpus all -it --rm --name temp traffic_monitoring_pipeline_with_git_v3
All dependencies have been installed. Execute the following commands:
$ cd module
$ python3 pipeline.py