Skip to content

ajcasagrande/rc-race-vision

Repository files navigation

RC Race Vision

RC Car detection using Computer Vision and YOLOv11. Blog Post

Notes

This was designed around being used with an Nvidia GPU, however it potentially will run (albeit much slower) on the CPU if you use --use-cuda False.

Also, the tracking logic currently is very taxing, and reduces the processing FPS drastically. Use --no-track to get an idea of the raw performance of the model.

Installation

This software requires the use of ffmpeg. If you have an Nvidia GPU, make sure you have the nvidia driver, CUDA, and that the version of ffmpeg you have includes support for nvidia encoding hevc_nvenc and nvidia decoding hevc_cuvid.

# Install requirements
pip install -r requirements.txt

# Remove headless opencv and re-install the regular opencv (weird quirk)
pip uninstall -y opencv-python-headless opencv-python
pip install opencv-python~=4.10.0.84

Make sure you have git-lfs installed, and then run the following to download the sample model and data:

git lfs pull

Example Usage

Tracking With Trail Stabilization

python vision_cli.py videos/rc_demo.mp4 \
    --show-preview \
    --preview-size 1280x720 \
    --save-video \
    --show-plot \
    --show-triangle \
    --triangle-size 10x10 \
    --triangle-thickness 2 \
    --show-trace \
    --start-time 5 \
    --yolo-size 1280x720 \
    --out-size 1280x720 \
    --vid-stride 1 \
    --trail-stabilize \
    --trace-length 500 \
    --trace-thickness 3
trail_stabilization.mp4

Tracking Without Trail Stabilization

python vision_cli.py videos/rc_demo.mp4 \
    --show-preview \
    --preview-size 1280x720 \
    --save-video \
    --show-plot \
    --show-triangle \
    --triangle-size 10x10 \
    --triangle-thickness 2 \
    --show-trace \
    --start-time 5 \
    --yolo-size 1280x720 \
    --out-size 1280x720 \
    --vid-stride 1 \
    --trace-length 500 \
    --trace-thickness 3
trail_no_stabilization.mp4

Basic Bounding Box + ID

python vision_cli.py videos/rc_demo.mp4 \
    --show-preview \
    --preview-size 1280x720 \
    --save-video \
    --show-plot \
    --show-box \
    --show-label \
    --start-time 5
basic_ids.mp4

No Tracking (Detection Only)

python vision_cli.py videos/rc_demo.mp4 \
    --show-preview \
    --preview-size 1280x720 \
    --save-video \
    --show-plot \
    --show-box \
    --show-label \
    --start-time 5 \
    --no-track \
    --conf 0.4
no_track.mp4

About

RC Car tracking using Computer Vision and YOLOv11

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages