Commit History
27 days ago
-
Phase 2: distance from focal length and pixel geometry
Aryan Sethi +1: Claude Opus 5 (1M context)src/depth/ground_plane.py is written to be transcribed: the ray-plane intersection a step at a time, with the two traps named -- h is the height above the road rather than a translation component, and Argoverse 2 pixels need undistorting before the pinhole model applies. A vectorised, distortion-aware form sits alongside it for the pipeline. Scored on nuScenes val against LiDAR ground truth, from ground-truth boxes: 1.05 m MAE under 10 m, 3.96 m at 10-20 m, 8.97 m at 30-45 m, every object given an estimate. The headline is not that number though. Read per class, cones look 5.91 m biased against barriers at 1.23 m, which reads as a class problem. It is not: inside any one scene the two classes agree closely, and the apparent cone bias is one scene holding 120 of the 265 cones. Median relative error per scene runs -35% to +35%, and fitting a single constant row shift per scene halves the error, 3.34 -> 1.71 m, with the worst scene going 6.56 -> 1.30 m on a -50 px shift. That is an effe…6b89d1b -
Mirror checkpoints to Drive, and move the logic out of the notebook
Aryan Sethi +1: Claude Opus 5 (1M context)Colab kills runtimes without warning and Ultralytics rewrites weights/last.pt in place every epoch, so a run that dies at epoch 140 leaves one mutable file and no history. CheckpointMirror copies last.pt out every N epochs under an epoch-stamped name. Fixes a race in the version this started from. It loaded last.pt to read the epoch, then copied it -- but Ultralytics can begin rewriting between those two steps, so a checkpoint that was loadable a moment earlier says nothing about what landed at the destination. The copy is now verified rather than the source, and os.replace publishes it, so a name on Drive only ever appears once the file behind it is whole. A failed verification unlinks the partial and retries on the next poll. Moved out of the notebook cell and into the repo so it can be tested. Notebook code cannot be reviewed or run in CI, and two of the last three failures here were notebook-only bugs. tests/test_checkpoint_mirror.py covers the torn-copy race, the duplicate-epoch…4027ed6
28 days ago
-
Make the gradient-norm probe safe to leave on
Aryan Sethi +1: Claude Opus 5 (1M context)No architectural change was involved in getting the gradient norm -- the model, loss, optimiser, data pipeline and resolved training config are untouched, and the logging attaches through the public add_callback API. But the probe patches torch.nn.utils.clip_grad_norm_, and reviewing that for what goes wrong in practice turned up three things worth fixing. Ultralytics fires on_train_end only on success, so a crash left the patch installed and the second model's probe then wrapped the wrapper, making restoration hand back a wrapper instead of the real function. install() now marks the function it creates and refuses to wrap a marked one, and train.py calls close() from a finally block. float() on a CUDA tensor synchronises the device, and clip_grad_norm_ does not otherwise sync since error_if_nonfinite defaults to False. Converting every step added a stall to every step of the run. Norms are kept as detached tensors and converted once per epoch instead. Gradient norm is now its own f…be3d1cc -
Phase 1: unified data pipeline, QA and training
Aryan Sethi +1: Claude Opus 5 (1M context)Extract cones, barriers, barrels and stop signs from nuScenes, Argoverse 2, COCO and BDD100K into one manifest carrying camera intrinsics and ground-truth distance, then train YOLO11n and YOLO11s on the derived YOLO export. The manifest is the artifact, not the .txt files: .txt cannot hold intrinsics or gt distance, and phase 2's geometric distance estimator needs both. 2D boxes are projected from the 3D cuboids rather than taken from a pre-made 2D annotation file, so boxes and distances come from one convention. merge.py asserts the cross-dataset geometry rather than leaving it to be eyeballed -- distance positive, distance and box-bottom row negatively correlated within a camera, median cone distance plausible. A coordinate convention mismatch otherwise produces a manifest that trains fine and makes the depth numbers nonsense a day later. Extraction and export run locally; only training moves to Colab, so the dataset is published to the Hugging Face Hub as tar shards with the mani…9274a8d