R.A.S logo: a silver and red shield with a helmeted rider and the letters RAS

R.A.S Open source

Rider Assist System · by Shahrukh Sheikh

Python · YOLOv8 · PyQt6 · Windows · MIT licence · Version 1.0.0

Ride footage that reads like a spotter was watching it.

R.A.S looks at every frame of your motorcycle POV video, finds the cars, buses, people and animals, and draws a HUD marker on each one. The closer it looks, the louder the marker: white, then yellow, then a pulsing red. Your own audio is left exactly as it was.

Free · Open source (MIT) · Runs on your PC · Nothing is uploaded · A video tool, not a safety system

A frame from a mountain ride filmed over the handlebars: a yellow and green bus approaching on a bend is outlined with a red corner-bracket marker.

R.A.S in numbers

3

Threat levels

White, yellow and red, chosen by how much of the frame an object fills.

7

Things it marks

Person, car, motorcycle, bus, truck, dog and cow. The list lives in a profile file you can edit.

4K

Tested resolution

The sample ride in the repository is 3840 by 2160 at 30 frames per second. There is no resolution limit in the code.

0

Videos uploaded

Everything runs on your computer. The model file is bundled, so detection works offline.

A helmet camera sees everything and shows you nothing in particular.

A camera strapped to a helmet records the whole ride, but a viewer can't feel which truck was close, where the bus came round the bend, or when a cow stepped onto the road. Pointing those moments out by hand, frame after frame, is hours of editing for one video.

R.A.S does the pointing for you. It's built for moto vloggers and anyone who wants a ride to look like it went through a spotter's HUD, and it's deliberately honest about what it is: a way to decorate footage you've already recorded, not a system that watches the road for you.

Six steps from raw footage to a marked-up video.

  1. Decode

    ffmpeg turns the video into raw frames, one at a time, at the original size.

  2. Detect

    YOLOv8n looks at the frame and returns a box and a name for each object, on the GPU if there is one.

  3. Filter

    Only the seven chosen kinds stay, and boxes that reach into the bike's own dashboard are dropped.

  4. Score

    The box's area, divided by the frame's area, picks white, yellow or red.

  5. Draw

    Corner brackets go on each object. Red ones pulse and glow harder, and a soft glow is blended over the frame.

  6. Encode

    The frames go straight into the encoder with your original audio copied alongside.

Closer looks bigger, and bigger looks louder.

R.A.S doesn't measure distance. It measures how much of the picture an object takes up, which on a fixed helmet camera is a good-enough stand-in for "how close". Two numbers in the profile decide the tier.

Red

Fills more than 7% of the frame

The thickest bracket. It pulses in width from frame to frame and gets a heavier glow around the box, so it is the first thing your eye lands on.

Yellow

Fills more than 3%, up to 7%

A medium, steady bracket. Something to notice: near enough to matter, not yet filling the view.

White

Fills 3% or less

A thin, quiet bracket for everything far off, so the road still looks full of life without shouting.

It is a size rule, not a distance reading. A big bus far away on a straight road and a small car close up can land in different tiers than you'd expect. That is fine for decoration and is exactly why R.A.S is not a safety tool.

Frames from the demo ride.

These are stills from videos that R.A.S rendered from my own mountain-ride footage, taken from the project's example output. Nothing here is mocked up. The markers are drawn thin on purpose so they don't hide the road, so look at the corners of the boxes.

A white hatchback ahead on a narrow mountain road, marked with small yellow corner brackets.
A car some way ahead gets a yellow bracket: near enough to notice, nowhere near filling the view.
A yellow and green bus coming round a bend, outlined in red corner brackets, with a second small marker on a vehicle far behind it.
The bus fills enough of the frame to turn red, and a small marker sits on the vehicle further back.
A loaded mule train in the distance and a rider on a motorcycle close on the right, who is outlined in red, with a small marker on a far vehicle.
Mixed scene: the rider close on the right is red, while the rest of the scene stays small and quiet.

Not every frame has a marker, and that's correct: if nothing from the list is in view, or it's too small for the model to catch, the picture is left alone.

One window, built like a race-bike dash.

Load a video, say where the new file should go and press Start render. The window is dark with red and cyan readouts, in a monospaced font, and it tells you what the engine is doing while it works.

  • Info strip: whether CUDA or the CPU is in use, the model (YOLOv8n), the profile (Motorcycle) and the resolution of the video you loaded.
  • Engine status: idle, rendering, stopping, complete, cancelled or error.
  • Live FPS: frames per second over the last second, plus the frame count and a progress bar.
  • Cancel any time. The render stops cleanly and the status says it was cancelled.
  • A log of what you loaded and where the output goes, and a clear message box if something fails.
The R.A.S window: red title bar text, an info strip reading CUDA DETECTED, YOLOv8n, PROFILE MOTORCYCLE and RESOLUTION 3840x2160, Load Input Video and Set Output Destination buttons, engine status IDLE, a progress bar at zero, a log, and Start Render and Cancel Render buttons.
The real window with the sample 4K video loaded, before a render. The "CUDA detected" label was forced on for this screenshot, taken on a PC with an NVIDIA card.

Everything R.A.S does.

Detection

  • YOLOv8n (the small, fast model) from the Ultralytics library, with its weights file bundled.
  • Every frame is checked, not a sample.
  • Seven kinds of object: person, car, motorcycle, bus, truck, dog and cow.
  • Dashboard ignore: a box that reaches below 70% of the frame height is skipped, so your own bike never gets marked.
  • Uses the NVIDIA GPU through CUDA when PyTorch can see one, and the CPU otherwise.

Overlay

  • HUD corner brackets instead of full boxes, 40 pixels long on each corner.
  • Three colours: white, yellow and red, by share of the frame.
  • Pulse: red brackets change thickness from frame to frame, and get a heavier glow around the box.
  • Glow: a blurred copy of the markers is blended in at 15%, so they look lit rather than stamped on.

Video pipeline

  • ffmpeg and ffprobe are bundled in the Windows build, so there is nothing to install.
  • Streaming: frames go decoder, detector, encoder through pipes. The whole video is never held in memory.
  • Hardware encoding: H.264 on an NVIDIA GPU (NVENC) when ffmpeg offers it, otherwise the CPU encoder (libx264), both at high quality.
  • Audio is copied from the original without re-encoding, and the output stops with the shorter of the two streams so sound and picture stay together.
  • Any size the video has: width, height and frame rate are read from the file.

Interface

  • Desktop window built with PyQt6.
  • Live FPS, frame count and progress while rendering.
  • Cancel button that stops the render safely.
  • Shows the resolution of the video you loaded and a log of what's going on.

Command line and profile

  • ras_cli.py renders one video from a terminal: --input, --output and an optional --profile.
  • One JSON profile holds the object list, the red and yellow thresholds, the dashboard cut-off, the glow size and the pulse speed.
  • The motorcycle profile ships with the project. Write your own for a bicycle, a car dashcam or a drone.

Trust

  • Open source (MIT): every line is on GitHub.
  • Local: no account, no upload, no tracking.
  • Plain about its limits: the disclaimer is in the README and on this page.

Run it from source today. The Windows build is on request.

R.A.S 1.0.0

The code is public and free. A ready-made RAS.exe exists, but at about 3.4 GB it is too big for a GitHub release, so it is shared on request.

Version 1.0.0Windows 10 / 11 · 64-bitMIT licenceFree

Run from source

You need Python 3.9 or newer. An NVIDIA GPU with a CUDA build of PyTorch is optional but recommended. The model weights file (yolov8n.pt) and the ffmpeg programs sit in the project folder.

git clone https://github.com/cybergears/ras-ai.git cd ras-ai pip install -r requirements.txt python main.py

Or from a terminal, for one video:

python ras_cli.py --input ride.mp4 --output ride_ras.mp4

Check that your GPU is visible: python -c "import torch; print(torch.cuda.is_available())". If it prints True, detection runs on the GPU.

Use it from the window

What you need.

R.A.S system requirements
Windows buildWindows 10 or 11, 64-bit. About 3.4 GB for the .exe.
From sourcePython 3.9 or newer, then pip install -r requirements.txt (ultralytics, torch, opencv-python, numpy). The desktop window also needs PyQt6.
Graphics cardOptional. An NVIDIA card with CUDA makes detection much faster. Without one it runs on the CPU.
Videos inAnything ffmpeg can read.
Video outH.264 video with the original audio copied across.
InternetNot needed to run. Only to download the code or the Python packages.

What it doesn't do.

Questions people ask first.

Is R.A.S free, and can I see the code?

Yes to both. It is open source under the MIT licence, and the whole project is on GitHub. Use it, change it, learn from it.

Is there a download I can just double-click?

There is a Windows build, RAS.exe, but it is about 3.4 GB because it carries PyTorch with CUDA inside, so it is not on the GitHub releases page yet (GitHub caps a release file at 2 GB). Today the supported way is to run it from source. If you want the .exe, email me.

Do I need an NVIDIA graphics card?

No, but it helps a lot. When it starts, the window shows GPU: CUDA DETECTED or GPU: CPU MODE. On the CPU it runs the same model, only much slower, so a long 4K ride will take a long time.

Does it change my audio?

No. The original audio is copied into the new file as it is, with no re-encoding. Only the picture is redrawn.

Can it warn me about real hazards while I ride?

No, and please don't use it that way. R.A.S works on footage you have already recorded. It is not a collision-warning or safety system, it does not measure distance, and it only draws markers for people to look at.

Why does my frame show no markers?

R.A.S only marks seven kinds of object (person, car, motorcycle, bus, truck, dog, cow). It also ignores any box that reaches below 70% of the frame height, which is where your own handlebars and dashboard sit, and the small YOLOv8n model can miss things that are far away. A clear road with nothing near is a clear frame.

Can I change the colours, thresholds or objects?

Yes, in profiles/motorcycle.json: the list of objects, the red and yellow thresholds, the dashboard cut-off, the glow size and the pulse speed. The command-line version can load any profile file with --profile. The desktop window always loads the motorcycle profile.

Can it process many videos at once?

No. It renders one video at a time, from the window or from the command line.

What is done, and what is only an idea.

1.0.0 February 2026 · current

  • Detection engine and command-line tool.
  • PyQt6 desktop window with live FPS and cancel.
  • Threat tiers, pulse and glow overlays.
  • Original audio preserved, GPU encoding with a CPU fallback.
  • Standalone Windows build with ffmpeg and the model inside.

Ideas, not built yet Roadmap

  • A preset system and a racing profile pack.
  • Lean-angle detection and a motion-based telemetry overlay.
  • A real-time live camera mode.
  • A macOS build.

Want the build story: why the threat level is a size rule, how the video is streamed through ffmpeg without filling memory, and what the frame-rate line in the code does?

Read the case study