ECLIPTIC jetson/ — the edge box Detector & training

jetson/ · the edge box

The detector, and the road to a model

Today's detector is deliberately model-free so bring-up needs no ML stack. The key architectural fact: the detector is the only piece that changes. Everything downstream — geometry, collision, the broadcaster, the wire format, the HUD — is fixed.

frames ──► [ DETECTOR ] ──► boxes+classes ──► geometry ──► DriverThreat ──► bus ──► HUD
            ▲ this is the only thing that evolves

What ships today

There is no trained model in this repository

No weights file, no inference runtime, no TensorRT / ONNX / YOLO / PyTorch anywhere in the tree.

MotionDetector is OpenCV MOG2 background subtraction: threshold, morphological open, external contours, area filter, centroid → bearing, bbox height → size, nearest-centroid track ids. Collision is a constant-bearing-while-growing rule — azimuth rate below a threshold while size is above a floor and increasing.

--source thermal|rgb runs it: plug in a UVC camera and moving bodies show up on the HUD immediately, with no trained model required. The trained detector drops in behind the same detect() signature later.

The re-baseline guard

normalize.ReBaselineGuard drops the whole frame when a thermal flat-field correction makes the subtractor call everything foreground, and suppresses three frames after. Reporting nothing is the right failure; reporting a scene full of people is not. A model-based detector will have its own version of this problem after an FFC.

Why train at all — the honest reason

Not accuracy polish

Background subtraction assumes a stationary camera. Parked or crawling, it works — which is most of an art car's life. Driving, the entire frame is “motion” and the detector degrades badly: dust, shadows and the moving background all read as contacts.

A learned detector does not care that the camera is moving, because it recognises people rather than change.

Stages

StageWhatState
0 — motion blobsBackground subtraction → contours. No model, no labels. Proves camera + geometry + bus + HUD the day it is plugged in. Weakness: reacts to any motion, no class, ids flicker.Shipping
1 — off-the-shelf RGBDrop in a COCO-pretrained detector (YOLOv8/v11-nano or NanoDet), keep only person and bicycle, export to TensorRT for the Orin. True person/bike detection in daylight with zero training. Mostly integration, not research.Not started
2 — thermalThe RGB model transfers poorly to 160×120 LWIR. Bootstrap from public thermal sets, and start collecting our own night clips.Not started
3 — fine-tuneSelf-collected thermal + RGB plus public thermal to fill gaps. Taxonomy person, person_on_bike, and a count bucket (1 vs 2+). Train, export ONNX → TensorRT.Not started
4 — day/night fusionLate fusion: RGB by day, thermal by night, merged by bearing before geometry. Auto-select on ambient light or time. Early pixel-level fusion is a later optimisation, not needed for v1.Not started

The bottleneck is footage, not compute

Training needed?Effort
RGB person detectionNo. COCO-pretrained models already detect personHours — export + integrate
Thermal person detectionYes, but bootstrap from public thermal dataDays–weeks, gated on our footage
The big GPUBarely relevantFine-tuning a nano model is <1 hr

An A100 or H100 fine-tunes a YOLO-nano on a few thousand images in well under an hour. What no amount of compute substitutes for is that nobody, anywhere, has recorded 160×120 ultra-wide LWIR from a mutant vehicle on a playa at 2am. That footage can only be captured while the rig is bolted to the car. GPU time can be rented any evening.

So the schedule-critical task is recording, not training. That is why --record was built before any model work. How to use it →

Where each stage runs

StageMachineArtifactPortable
CollectJetson, on the vehicleframes + index.jsonlYes
LabelLaptop (+ auto-label on a server)YOLO .txtYes
TrainThe H100 boxbest.ptYes
ExportAnywheremodel.onnxYes
Build engineThe Orin itselfmodel.engineNo
InferOrin——
TensorRT engines are not portable

They are built against a specific GPU architecture, TensorRT version and CUDA version. An engine built on an H100 (Hopper, SM 9.0) will not load on an Orin (Ampere, SM 8.7). Export ONNX on the server, convert to .engine on the target.

To be unambiguous, since this reads as scarier than it is: you never train on the Jetson. Only the final trtexec compile runs there — a few minutes, one command, once per model. ONNX is the source code; .engine is the compiled binary, and only the binary has to match the target.

Public data, and its domain gap

DatasetWhat it isLicence
Teledyne FLIR ADAS (v1/v2)~10k+ annotated thermal frames, person/bike/carFree, registration
KAIST MultispectralAligned thermal+RGB pedestrian pairs, day and nightAcademic

Mind the domain gap. FLIR ADAS is 640×512 Boson, forward-facing, mounted on a car at road height, with a normal lens. Ours is 160×120, ultra-wide fisheye, mounted on an art car, looking at people standing around the vehicle rather than ahead of it. Different resolution, distortion, viewpoint and range. Public data gets you to “detects warm humans”; our own data gets you to “works on our rig”.

Labelling is the real bottleneck — spend the GPU there

500–2,000 corrected frames is a realistic target for fine-tuning a pretrained model into a narrow domain. This is not a tens-of-thousands-of-images job — it is adapting a model, not training from scratch.

Auto-label first, then correct. For the actual training run a big GPU box is wild overkill — a nano fine-tune is one GPU for twenty minutes. Where it genuinely pays is running a large open-vocabulary detector (Grounding DINO, YOLO-World, SAM) across every recorded frame. Then a human reviews rather than draws — the difference between a weekend of labelling and an evening.

Two things help on thermal specifically: the motion boxes already recorded give a seed layer, and if the spare RGB is co-mounted with the thermal in the forward pod, a COCO model's confident RGB detections can seed labels on the time-synced thermal frames. Same scene, near-identical viewpoint, so the easy modality generates labels for the hard one. That is a real argument for doing that co-mount rather than treating the spare RGB as merely a spare.

Validate by range, not by mAP

A single mAP number hides the thing that matters. Measure precision and recall in range buckets (0–5 m, 5–15 m, 15–30 m, 30 m+). A useful warning at vehicle speed means reliable detection at ≥30 m; a model that is brilliant at 3 m and blind at 25 m scores well and is useless.

Constraints on any replacement detector

  • ReBaselineGuard behaviour must be preserved in some form.
  • TRACK_ID_LIMIT = 1000, coupled to rig.ID_STRIDE: global ids are camera_index × 1000 + local_id, so any new id scheme must stay inside [1, 1000) per camera, and 0 must keep meaning “unidentified” — it never latches the tracker light.
  • CollisionEstimator stays. What it needs is stable ids — upgrade the nearest-centroid matcher to ByteTrack or SORT once a real detector feeds it, so the bearing-rate estimate is clean.
  • Latency target ~10 Hz end to end. The bus and HUD are already comfortably faster; nano-class detectors on TensorRT clear 10 Hz with headroom.

What to actually do, given the calendar

The honest answer
  1. Do not gate the event on a trained thermal model. Training on footage that does not exist yet, alongside the mechanical build, is not a three-week task.
  2. Ship what works: motion detection (fine while parked and crawling, which is most of an art car's life) plus Stage A RGB, which is integration work with no dataset dependency and covers daylight properly.
  3. Record everything, from the first test drive onward. Every hour of footage is an asset that cannot be back-filled after the event.
  4. Train after, with real data, for next year.

BRC 2026 passed without zvision running on the vehicle and the cameras are still not mounted, so the same order holds for the next event. The mistake to avoid is spending the run-up on model work and arriving with an untested rig. The mistake that costs the most is arriving, having a great week, and coming home with no footage.

Cost of being wrong

Both detectors are wrong sometimes, in opposite directions. A false positive puts a phantom contact on the HUD and swings the tracker light at nobody — annoying, and it erodes trust in the display. A false negative means a person near a moving vehicle is not shown. Tune toward false positives; that is what --collision-min-size and --min-area are for.

Blocked on hardware — highest-value remaining item

MotionDetector resets a track on a single-frame dropout, which biases toward false negatives while driving. Fixing it needs real bodies at real distances in front of the real camera. Do not add tablet-side contact coasting until this is fixed — coasting by id while the Jetson churns ids draws one person as two.

Converted from
jetson/DETECTOR.md · jetson/TRAINING.md · ARCHITECTURE.md §6.3 · tasks/open.md