Skip to main content

Camera-based Car Speed Detection for Autonomous Driving

Using our library with optical flow to detect the speed for the car

Car-Speed-Detection provides a python library to detect the speed of the driving car itself by the video stream from the dashboard camera installed on the car.

Car-Speed-Detection separates the speed detection process into three steps, preprocessing, training, and speed detection. By using Gunnar-Farneback optical flow algorithm along with the pipeline we developed, we are able to extract each frame into a small size matrix depends on developers preference. We use the Artifitial Neural Network (ANN) to train our model with the preprocessed matrix acquired from preprocessing function. Developers could use the trained model to detect the speed of the car at each frame using our speed detection function.

Getting Started

Installation

Car-Speed-Detection is available on PyPI and can be installed via pip. See car-speed-detection.readthedocs.io to learn about the API and Q&A of our library.

pip install car-speed-detection

Read, Preprocess, Train, and Detect the Car Speed

The Car-Speed-Detection library consists of the following parts:

  • Read (Read the mp4 video and output each frame into a designated directory)
  • Preprocess (Preprocess each frame and output a feature set for training)
  • Train (Train the model using the feature set and Artifitial Neural Network)
  • Speed Detection (Detect the speed using the model and video)

API and Example Code

Take a look at the API to know more about the Application Programming Interface and Sample for further information on how to use our library.

Result

In our example code, we are able to train the model with MSE error less than 2 using the training video provided by comma.ai. We separate the video into 75% for training and 25% for testing so the result woud be fair. The ANN model has also substaintially small amount of parameters (< 45,000), which yeild a lower latency compare to other solutions.

Bugs Report

Issues and bugs can be reported by emailing lienshaochieh@gmail.com

At a minimum, the report must contain the following:

  • Description of the program.
  • Expected Result.
  • Actual Result.
  • Steps to reproduce the issue.

Please do not use the GitHub issue tracker to submit bugs reports. The issue tracker is intended to make feature requests.

Acknowledge

This project is managed by Shao-Chieh Lien, the software architect and student at Purdue University.

This was a senior design project at Purdue University. Christopher Crocker was in charge of generating the training data using Carla simulator that could be seen from this Github repository and Data Section. Meenakshi was in charge or paper writing and documentation.

Special thanks to Professor Santiago Torres-Arias at Purdue ECE department for his guidance throughout our whole software development cycle!

Metadata

Release files for car-speed-detection 1.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for car-speed-detection 1.7.0
File Size Uploaded Provenance Actions
car_speed_detection-1.7.0.tar.gz 9.3 kB Without provenance Details for car_speed_detection-1.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for car-speed-detection 1.7.0
File Interpreter ABI Platform Actions
car_speed_detection-1.7.0-py3-none-any.whl Python 3 none any Details for car_speed_detection-1.7.0-py3-none-any.whl

Total release size: 23.2 kB

Release files / car_speed_detection-1.7.0.tar.gz

Download URL car_speed_detection-1.7.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ae10a8e17559d751cf6b630c546c5a231ceebff2f93a29b40c4002607d6d9ae2
BLAKE2b-256 checksum
How to use checksums
c123c8baa3d000af2c9ebf3511946e848f0b4c18406b250f734974848b3e05f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

Release files / car_speed_detection-1.7.0-py3-none-any.whl

Download URL car_speed_detection-1.7.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fac59df25742be364ea3e288648ea48363e5618cc64d8372412db5ed8a1c1cc
BLAKE2b-256 checksum
How to use checksums
9729d832c1c7e98d4aca7ca666aa9af61b8e52c3966c83996a7bcf077dca0a21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

Security for car-speed-detection 1.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page