AfroViewz pothole detector (browser model)
The model behind the AfroViewz app: RF-DETR Nano at 384 px, fine tuned to find potholes in road photos, dashcam video and the live phone camera. It runs on the device in the browser with onnxruntime-web (WebGPU, with a WebAssembly fallback).
Code, data pipeline and evaluation notebooks: https://github.com/JBWandera/Capstone
Results (test split, 592 images, 846 potholes)
| mAP50 (95% CI) | mAP50:95 | ms per image (L4) | |
|---|---|---|---|
| This model (E5 Nano, road band crop) | 0.643 (0.599 to 0.694) | 0.344 | 4.6 |
The best AfroViewz model (RF-DETR Small, road band crop, 704 px) reaches 0.730 mAP50; this Nano is the one that runs smoothly on a phone.
How to run it
- Input
input: float32[1, 3, 384, 384], RGB, resized with plain bilinear interpolation (no antialiasing), scaled to 0..1, normalised with ImageNet mean and std. - Outputs:
dets[1, 300, 4]boxes as cx, cy, w, h fractions of the image;labels[1, 300, 2]logits. Score = sigmoid of the best logit per query. No NMS needed. - Dashcam frames: crop to the band between 35% and 75% of the image height before inference (as in training), then shift boxes back.
Weights are stored in float16 and cast to float32 inside the graph, so results match the float32 model (top score difference under 0.002).
Training data
Stellenbosch Road Pothole Images (CC0), two public Roboflow Universe pothole datasets, with grouped, leak free splits. See the repository for the full data card.
Limitations
Trained mostly on South African dashcam frames and close up phone photos. Accuracy on Ugandan roads is being measured on a separate, hand checked Mapillary test set. Not a safety system.