GithubHelp home page GithubHelp logo

shaunmulligan / radr Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 14.05 MB

An AI powered rear facing radar for your bike. Instead of using mmWave radar tech, this project uses an inexpensive raspberry pi zero 2, a camera and Coral.ai TPU accelerator to detect objects behind you.

Dockerfile 2.80% Python 97.20%
ai coral-tpu cycling machine-learning python raspberry-pi

radr's Introduction

Radr

radr

An smart rear facing radar for your bike. Instead of using mmWave radar tech, this project uses an inexpensive raspberry pi zero 2, a camera and Coral.ai TPU accelerator to detect objects behind you.

MVP features:

  • Detect cars, cyclist (person + bicycle) and people behind you.
    • Use the Coral.ai TPU accelerator to run the model, hopefully at ~ 25 FPS.
    • Track multiple objects at once.
  • Implement the radar BLE Gatt service to send alerts to a cycling computer.
  • 3D print a case for the pi zero 2, camera, TPU accelerator and battery that slips in under the saddle.

Future features:

  • Add neopixel LEDs controllable via BLE Gatt service.
  • brighten LEDs when an object is detected.
  • Add ability to record video of the ride.
  • periodically save images + detection while riding and upload to cloud
  • Use the cloud to train a custom model on the images. Using something like v7Labs, roboflow or ClearML.
  • Have Models be versioned and deployed to the device via wifi when device is charging.

Usage

  1. Build the container:
cd radr && sudo docker build -t radr-v1 .
  1. Run the container:
sudo docker run --rm -it --privileged radr-v1

The --privileged flag is required to access the camera and USB accelerator. 3. You should now be able to see the video stream on http://<RPI_IP_ADDRESS>:8080/video

Testing with video file.

If a video file with .mp4 extension is found in the root directory, the model will run on the video file instead of the camera. This offers a nice way to consistently test the model on a known input.

Example of the current model output:

object detection on road image

radr's People

Contributors

shaunmulligan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

radr's Issues

Optionally have a way to view the video stream with detections and tracking data overlayed

Option 1 - On screen:
Easy to do in opencv but won't be super useful when we have the device mounted on the bike with no screen (VNC maybe). This might be harder in docker as well as we need to pass in the x-org display but will be helpful while debugging and testing things.

Option 2 - http stream:
Ideally, we can have the image feed served via fastAPI and then just connect to it and view with the laptop. Have a look at https://github.com/zauberzeug/nicegui/blob/main/examples/opencv_webcam/main.py

Run testing on power consumption

We want to know how much power each part of the system uses and how much it uses when its running at full speed. Once we have these numbers we can figure out how to quantify and optimise battery usage.

Only run inference when we are moving

Assuming running inference uses a lot of power, we could add an IMU sensor and detect when we are in motion and only actually do inference while we are moving.

Add controllable neopixel LEDs

  1. Should be able to switch on with a button
  2. Would be amazing to implement BLE light protocol to make them controllable from head unit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.