# pipeline_360 — Rust/WebGPU rewrite An in-progress rewrite of the Python `pipeline_360.py` equirect→COLMAP-cubemap rig pipeline in **Rust**, with all heavy image math on the **GPU through WebGPU** (`wgpu`) for cross-vendor compatibility (Vulkan / Metal / DX12, and WebGPU/wasm). > **Status: complete — single binary, masks default, native GUI, GPU masks.** > One `pipeline_360` binary runs the full GPU pipeline and, with > `--features gui`, also launches a native egui+wgpu GUI when invoked with no > subcommand. The YOLO masks stage is on by default. Validated end-to-end on > real 8K equirect video. `cargo test` passes; 0 clippy warnings in pipeline > code. YOLO11x-seg via ONNX Runtime, and masks now run on the **GPU** (AMD > MIGraphX/ROCm) and on the **cube-face images** directly (no equirect > round-trip). All GPU stages are **batched** for throughput. > See [PLAN.md](PLAN.md) for the full design and milestone list. ## Current state | Piece | Status | | --- | --- | | `math.rs` (face rotations, quaternions, intrinsics) | ✅ pure std, verified | | `stages/rig.rs` (rig_config.json + nested tree + linking) | ✅ pure std, verified | | `selftest.rs` (mirrors Python `rig --self-test`, 6 groups) | ✅ passes (`cargo test`) | | CLI / `main.rs` (derive-based, mirrors Python commands) | ✅ `extract` + `cubemap` + `all` + `rig` work | | `video/mod.rs` (ffmpeg/ffprobe CLI decode → rawvideo RGBA) | ✅ verified end-to-end | | `gpu/mod.rs` (adapter prefers **discrete** GPU; batched readback) | ✅ picks the dGPU (was defaulting to LowPower/iGPU) | | `gpu/shaders/equirect_to_cubemap.wgsl` | ✅ projection verified vs `py360convert.e2c` | | `gpu/shaders/sharpness.wgsl` (workgroup-reduced metrics) | ✅ verified end-to-end | | `gpu/shaders/c2e.wgsl` (cubemap→equirect nearest) | ✅ round-trip validated (legacy mask reprojection) | | `stages/extract.rs` (GPU sharpness + quality + selection, **batched**) | ✅ superset of Python; verified | | `stages/cubemap.rs` (GPU equirect→6 faces, skip/resume, **batched**) | ✅ verified vs `py360convert.e2c` | | `stages/masks.rs` (YOLO11x-seg on cube faces; **MIGraphX GPU**; cache) | ✅ IoU 0.96 vs ultralytics | | `gui.rs` (native **egui+wgpu** GUI; in the same binary via `--features gui`) | ✅ builds & runs | ## Build There is **one binary**, `pipeline_360`. The YOLO masks stage is **on by default** (via ONNX Runtime). Use `--no-default-features` for a lighter build without masks. ```bash cargo build # default: full pipeline incl. YOLO masks ./target/debug/pipeline_360 all --project-dir --video --skip-masks cargo test # runs the rig self-test (6 groups) cargo run -- rig --self-test # Lighter build without ONNX Runtime (no masks stage): cargo build --no-default-features # Run the GPU extract stage (needs ffmpeg/ffprobe on PATH + a GPU): cargo run -- extract --video