An open API service indexing awesome lists of open source software.

https://github.com/allisterb/trafficcv

A small OpenCV-based cross-platform library and program that runs different computer vision and deep learning model inference on videos and live streams of traffic .
https://github.com/allisterb/trafficcv

cv opencv-python traffic-analysis

Last synced: 3 months ago
JSON representation

A small OpenCV-based cross-platform library and program that runs different computer vision and deep learning model inference on videos and live streams of traffic .

Awesome Lists containing this project

README

        

# TrafficCV
TrafficCV is a small OpenCV-based cross-platform program and library that runs different object detection models on live streams or videos of vehicle traffic to compute and estimate information such as vehicle speed, vehicle class, the number of vehicles passing through a Region of Interest (ROI) and so on. You specify the model to run using the `--model` parameter and the video source using the `--video` parameter together with an optional `--args` parameter that specifies a comma-delimited set of model or detector arguments in the form key=value. .

TrafficCV can run models on traffic videos from YouTube and other video hosting sites using VLC which is installed by default on the Raspberry Pi. The `vlc-stream` scripts accept as a parameter a file or URL and then creates a Multipart-JPEG (MPJPEG) stream on the current computer on port 18223. MPJPEG is a simple way to stream Motion-JPEG (M-JPEG) encoded videos over HTTP that can be processed by OpenCV. Any video source which can be decoded by VLC can be transcoded and streamed to OpenCV allowing you to analyze live-streamed videos in many different formats and locations.

## Installation
Clone the repo and run pip install -r requirements.txt in the project folder. Models can be downloaded from [here](https://ajb.nyc3.cdn.digitaloceanspaces.com/models.zip), and demo videos [here](https://ajb.nyc3.cdn.digitaloceanspaces.com/demo_videos.zip). Expand the archive files in the project folder so you have a `models` and `demo_videos` folder. Depending on the models you want to use you should then install the [TensorFlow Lite runtime](https://www.tensorflow.org/lite/guide/python) or the [EdgeTPU runtime](https://coral.ai/software/#edgetpu-runtime).