# A street detector that also works from the sky
COCO has a class for hair driers. It doesn't have one for e-scooters, license plates, traffic cones or ambulances.
Most detectors running on roads today are COCO detectors, so they inherit 80 classes picked for a benchmark in 2014. A road camera doesn't need a toothbrush or a hair drier. It needs to tell an e-scooter from a bicycle, find the plate and the face to blur, and keep working when the camera sits on a pole or a drone instead of at eye level.
So we built one for that. **mayaku street** is a detector and instance segmenter for 22 classes picked for traffic, in two sizes (nano, 5.2M parameters, and M, 32.4M). It's trained on every view a camera on a road has, from a dashcam to straight down from a drone, and it's trained for int8, so going to int8 costs almost no accuracy. Apache 2.0.
Full disclosure: I develop [mayaku](https://github.com/emrahnazif/mayaku). The comparisons below are mine, and I explain further down why none of them is apples to apples.
### 22 classes for the road
| group | classes |
|---|---|
| people | person, face, helmet |
| micromobility & assistive | bicycle, e-scooter, motorcycle, wheelchair, stroller |
| vehicles | car, truck, bus, emergency vehicle, train, three-wheeler, construction vehicle, trailer |
| road objects | license plate, traffic light, safety sign, stop sign, traffic cone |
| other | animal |
Twelve of these don't exist in COCO: e-scooter, license plate, face, helmet, traffic cone, safety sign, wheelchair, stroller, three-wheeler, construction vehicle, trailer and emergency vehicle. Every class comes with an instance mask, not only a box.
Top: mayaku street M. Bottom: YOLO26l. COCO has no scooter class, so the closest thing it knows is a bicycle.
The class definitions matter as much as the list, and some of them are deliberately not COCO's:
- **car** is every light vehicle: car, van, SUV, taxi, pickup. Nobody watching a road cares whether it's a van or an SUV, and in an earlier version those borders made the model flicker between labels on the same vehicle.
- **truck** is heavy goods vehicles only. (COCO calls pickups trucks.)
- **e-scooter** is the stand-up kind: Lime, Voi, kick scooters. A seated Vespa-type scooter is a **motorcycle**.
- **emergency vehicle** is police car, ambulance and fire engine.
- **safety sign** is regulatory and warning signs. Street names, directions and shop signs are not labelled, because they're not what a traffic application asks about.
- **face** is human faces, **helmet** is any helmet. With **license plate**, that's what you need to blur footage: the faces and plates in the video above were blurred with mayaku street's own detections.
Top: mayaku street M finds the police car as an emergency vehicle. Bottom: RF-DETR large calls it a car, which is correct in COCO: there's no emergency-vehicle class to get right.Left of the line mayaku street M, right RF-DETR large at its default threshold (0.5). Source video on Pexels.
I was honestly shocked by this one. It's a relatively easy scene: people in daylight, seen from above, nothing hidden. At its default threshold of 0.5, RF-DETR large finds the backpacks but almost none of the people. Lower it to 0.3 and it does find them.
Here's the clip without any detections, the same footage as on [Pexels](https://www.pexels.com/fr-fr/video/vue-aerienne-d-un-passage-pieton-anime-en-ville-36673526/), only cropped from portrait to landscape like in the video above. Run it through any model you like.
### Trained for int8
"int8 supported" usually means: calibrate it yourself, and lose a few AP. mayaku models are trained with int8 in the loop (quantization-aware training), so there's no calibration step, and the exported file is a true int8 graph. One checkpoint exports to ONNX, OpenVINO, TensorRT and Core ML.
Box AP on a fixed 1,467-image slice of the validation set:
| | FP32 | ONNX int8 | OpenVINO int8 |
|---|---:|---:|---:|
| street nano | 44.26 | 44.39 | 44.55 |
| street M | 56.28 | 56.10 | 56.08 |
On TensorRT, street M runs at 2.80 ms per frame in int8 against 5.36 ms in FP16 (RTX 3060, network only). End to end, from a 1080p frame to final boxes, that's 3.94 ms against 6.42 ms.
One honest footnote. During training, the int8 simulation used a symmetric grid for every activation. Most activations come out of a ReLU and are never negative, so half the grid was wasted: effectively 7 bits instead of 8. That cost box accuracy after quantization, about 0.4 AP.
The ONNX and OpenVINO exports now give those activations the full grid, which is the table above. TensorRT can't do that remapping, so on TensorRT the int8 engine is still 0.3–0.45 AP below FP16. The fix there is on the training side, and it goes into the next retrain. It's a mistake in how I trained, not a limit of the model.
### Every class on every image
The dataset is 352k images (334k for training, 18k for validation): Objects365 and COCO train2017 for scale and everyday scenes, Wikimedia Commons for e-scooters (almost absent elsewhere), roundabouts, highways and aerial photos, and three open drone and aerial datasets for the views from above.
You can't just merge those datasets' labels. An Objects365 image is labelled for Objects365's classes, a COCO image for COCO's. Put them together and every image is missing the other dataset's classes, and each missing label teaches the model that a real object is background.
So none of the sources' own labels became training labels; we only used them to choose images. Every image was labelled from scratch by one labeller, [SAM3](https://github.com/facebookresearch/sam3), with the same 46 text prompts, on the whole image. Each object gets a mask, and the box is the mask's extent. Then a set of export rules cleaned up what SAM3 gets wrong:
- synonyms merged into one class (van, taxi, pickup → car; tram → train; police car, ambulance, fire engine → emergency vehicle),
- two small classifiers on crops: one keeps only safety signs out of SAM3's "any sign" (about 60% were street names and shop signs), one sends seated mopeds from e-scooter to motorcycle (17% of the old e-scooter labels),
- a second labelling pass on drone frames, in tiles, because whole-frame SAM3 missed tiny people,
- faces on animals dropped, one box per object, no "row of parked bikes" boxes.
The result is 4.36M training objects, one definition per class, every class on every image. Not a single box was drawn by hand.
### Not apples to apples
Before any comparison numbers: none of them is fair, in either direction.
YOLO26 and RF-DETR are built for COCO's 80 classes and COCO's way of drawing boxes. mayaku street is built for 22 classes and its own definitions (a pickup is a car here and a truck in COCO). On COCO, they have home advantage. On our validation set, we do. So read the numbers below as "what you get if you use each model for the other's job", on the 10 classes both sides have.
To keep it as fair as I could: classes only one side has are not scored, objects of our extra classes are ignored for the COCO models (calling a tuk-tuk a motorcycle is neither a hit nor a miss), car and truck are merged into one "vehicle" class because the two sides draw that line in different places, and COCO val2017 was never in our training data. Each COCO model's own COCO AP reproduces its published number with this code.
### On their ground: COCO
COCO val2017, 5,000 images, COCO's own labels. mayaku street has never seen a COCO label.
| model | params | AP | AP small | AP large | person | vehicle | animal |
|------------------------|---:|---:|---:|---:|---:|---:|---:|
| YOLO26n | 2.6M | 48.6 | 19.0 | 72.8 | 52.9 | 39.6 | 53.4 |
| **Mayaku street nano** | 5.2M | **51.2** | 28.3 | 70.0 | 56.5 | 49.6 | 50.3 |
| RF-DETR nano | 30.5M | 53.5 | 24.9 | 81.1 | 55.6 | 45.0 | 58.8 |
| **Mayaku street M** | 32.4M | **57.1** | 36.4 | 75.7 | 61.6 | 55.2 | 59.4 |
| YOLO26m | 21.9M | 59.4 | 37.0 | 79.4 | 64.1 | 53.7 | 64.0 |
| RF-DETR medium | 33.7M | 60.1 | 36.4 | 82.5 | 62.9 | 54.1 | 65.4 |
| YOLO26l | 26.3M | 60.4 | 36.2 | 79.7 | 65.2 | 55.3 | 65.2 |
| RF-DETR large | 33.9M | 61.8 | 39.3 | 83.1 | 65.1 | 57.0 | 67.2 |
street nano beats YOLO26n. street M trails the medium and large COCO models by 2–5 AP, mostly on large objects.
Is that the model, or the labels? Mostly the labels. Our labels draw a person, a car or a dog one way, and COCO's annotators drew them another: crowds, partly hidden objects, pickups as trucks. A model trained on one style loses points when it's scored against the other. More COCO AP will come from better labels, not from more training on the same ones.
### On ours: the street
Our validation set, 17,712 images from all six sources, SAM3 labels, same 10 classes:
| model | AP | AP small | AP large | person | vehicle | animal | traffic light | bus |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
| YOLO26n | 34.1 | 7.2 | 65.4 | 37.1 | 26.6 | 30.0 | 22.5 | 47.2 |
| RF-DETR nano | 40.9 | 10.2 | 75.1 | 38.0 | 33.7 | 36.3 | 26.4 | 55.7 |
| YOLO26m | 51.0 | 22.9 | 77.8 | 55.0 | 44.0 | 46.6 | 44.4 | 60.3 |
| RF-DETR medium | 51.9 | 22.1 | 81.1 | 50.7 | 48.3 | 47.2 | 39.4 | 64.1 |
| **street nano** | **52.2** | 25.3 | 74.8 | 53.2 | 61.4 | 42.2 | 40.1 | 67.9 |
| YOLO26l | 53.2 | 24.6 | 79.8 | 57.2 | 47.0 | 48.7 | 46.6 | 63.0 |
| RF-DETR large | 56.3 | 28.4 | 82.2 | 56.0 | 54.8 | 51.3 | 45.2 | 67.5 |
| **street M** | **65.3** | **41.0** | **84.2** | **66.1** | **72.3** | **57.5** | **55.6** | **78.6** |
This is our home ground, so part of this margin is ours by construction: same labeller, same class definitions. Still, the speed side doesn't depend on labels, and it's where the two street models sit apart from the rest:
End to end: 1080p frame in RAM to final boxes, each library's own pipeline. RF-DETR's time is mostly CPU pre-processing; see Latency lies (a little).
In the network alone, street nano (1.49 ms) is 2.8× faster than YOLO26l (4.19 ms) at about the same street AP. street M takes about the network time of RF-DETR large (5.36 vs 5.42 ms) for +9 AP, and half of that in int8.
The FPS in the corners of the video are a different measurement: the segmentation versions, end to end to final masks, each library at its own default threshold (details at the end of the video). Pasting masks into a 1080p frame adds time for every library, so those numbers are lower than the detection times here.
At night, from a high window. Left of the line mayaku street M, right RF-DETR large.
### From the sky
This is the result I trust most, because it barely depends on whose labels you use: from above, COCO models mostly stop working.
Straight down. mayaku street M: 40 objects. RF-DETR large: 0. YOLO26l: 0. Each at its default threshold; counts are over the full frame.
Drone and orthophoto images are only 3% of our training data, but they're enough. Per source, same merged-vehicle protocol:
| source | YOLO26l | RF-DETR large | street nano | street M |
|---|---:|---:|---:|---:|
| COCO images (seen by the COCO models in training) | 67.0 | 68.8 | 60.7 | 72.6 |
| Objects365 images | 56.5 | 59.3 | 52.5 | 66.0 |
| Wikimedia Commons | 35.2 | 38.1 | 33.6 | 46.9 |
| oblique drone, roundabouts | 8.8 | 16.7 | 21.8 | 24.8 |
| drone, 4K over a city | 2.6 | 5.6 | 15.3 | 24.5 |
| straight-down aerial, 8 cm/px | 4.2 | 6.5 | 19.4 | 22.6 |
The absolute numbers from above are low for everyone, because almost every object there is tiny (a car in the city drone footage is about 18×9 pixels). But 2.6 versus 24.5 is the difference between a model that doesn't work and one that does.
An oblique drone view. mayaku street M: 91 objects. RF-DETR large: 5. YOLO26l: 29. Counts are over the full frame.
### What it still gets wrong
Most of the remaining mistakes come from the labels, not from model size:
- **Faces without people.** Our labels include faces on dolls, posters and statues (SAM3 marks them), so the model predicts them too. 4% of the face labels in the validation set aren't on a person.
- **Statues as people**, for the same reason.
- **truck ↔ car** is the most common confusion. Part of that is the definition (a pickup is a car), part is SAM3 drawing that line inconsistently.
- **Tiny people on drone frames**: some false positives under 8 pixels.
- **Weakest classes**: trailer (24.5 AP), stroller (26.9) and wheelchair (32.5) for street M. Wheelchair is the rarest class (1.5k training objects); trailers and strollers come in many shapes and are often partly hidden.
- **Crowds**: the default NMS (IoU 0.5) removes duplicate boxes well but drops about 6% of people standing right next to each other. If you count crowds, raise the NMS IoU (0.7 keeps them).
- **Emergency vehicles score lower than they should** on our own validation set: I corrected the training labels, but not the validation labels, so a right answer there often counts as a wrong one.
The next round of work is labels: faces and statues, the truck line, tiny drone people, and the int8 training fix above.
### Try it
```python
from mayaku import from_pretrained
model = from_pretrained("mayaku-n-seg-street") # or mayaku-n-det-street, mayaku-m-seg-street, mayaku-m-det-street
for det in model("street.jpg"): # threshold 0.4, NMS 0.5, from the checkpoint
...
model.export("onnx", "street.onnx") # also openvino, coreml, tensorrt; int8 supported
```
```
pip install mayaku
```
The checkpoint carries its classes, input size and prediction threshold, so there's no config file. If you run a tracker that keeps tracks alive with low-score boxes (ByteTrack), use a threshold around 0.1.
| | street nano | street M |
|---|---:|---:|
| parameters (det / seg) | 5.2M / 5.3M | 32.4M / 32.6M |
| box AP, street val (22 classes) | 43.9 | 56.8 |
| mask AP, street val | 35.2 | 45.5 |
| TensorRT FP16 / int8, network, RTX 3060 | 1.49 / 1.01 ms | 5.36 / 2.80 ms |
- [mayaku on GitHub](https://github.com/emrahnazif/mayaku) · [docs](https://emrah.fr/mayaku/)
**Credits.** Labels made with [SAM3](https://github.com/facebookresearch/sam3) (Meta). Images from [Objects365](https://www.objects365.org/) and [COCO](https://cocodataset.org/), and from Wikimedia Commons under their individual free licences. Drone frames from Songdo Vision (CC BY 4.0; Fonod, Cho, Yeo and Geroliminis, *Transportation Research Part C* 178:105205, 2025) and the roundabout aerial dataset (CC BY 4.0; De-Las-Heras, Sánchez-Soriano and Puertas, [Zenodo 6362361](https://zenodo.org/records/6362361)). Aerial photos: Beeldmateriaal Nederland / PDOK (CC BY). All clips in the video are from [Pexels](https://www.pexels.com/).