Skip to content
ooolabdevPublic

About

A maintained Brush fork for OOOSplat.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Brush

BrushSizzleCompressedFrame.mp4

Massive thanks to @GradeEterna for the beautiful scenes

Brush is a 3D reconstruction engine using Gaussian splatting. It works on a wide range of systems: macOS/windows/linux, AMD/Nvidia/Intel cards, Android, and in a browser. To achieve this, it uses WebGPU compatible tech and the Burn machine learning framework.

Machine learning for real time rendering has tons of potential, but most ML tools don't work well with it: Rendering requires realtime interactivity, usually involve dynamic shapes & computations, don't run on most platforms, and it can be cumbersome to ship apps with large CUDA deps. Brush on the other hand produces simple dependency free binaries, runs on nearly all devices, without any setup.

Try the web demo chrome logo NOTE: Only works on Chrome and Edge. Firefox and Safari are hopefully supported soon)

Features

Training

Brush takes in COLMAP data or datasets in the Nerfstudio format. Training is fully supported natively, on mobile, and in a browser. While training you can interact with the scene and see the training dynamics live, and compare the current rendering to input views as the training progresses.

It also supports masking images:

  • Images with transparency. This will force the final splat to match the transparency of the input.
  • A folder of images called 'masks'. This ignores parts of the image that are masked out. Black pixels in the mask are ignored, white pixels are kept. Pass --invert-masks if your masks are the other way around.

MoGe-2 geometry training

On prepared datasets Brush adds Gaussian shortest-axis orientation (0.05), multi-view free-space opacity (0.02) and ray depth dispersion (0.01) to the RGB objective. Each training stage warms up for 500 steps and ramps the weights over the next 500. Depth maps supply an edge mask for orientation and a calibrated free-space cutoff. The objective omits both calibrated depth regression and relative depth correlation.

Start with a complete, undistorted COLMAP PINHOLE dataset. For each registered images/cam/view.jpg, supply MoGe-2 relative camera-Z in depths/cam/view.png (16-bit grayscale, zero invalid) and camera-space normals in normals/cam/view.png (8-bit RGB, black invalid, axes right/down/forward). For example, using Spirula's geometry command and a MoGe-2 ONNX model with normals:

spirula geometry .\dataset --model .\moge2-vitb-normal.onnx --depth --depth-units relative --ray-depth no --normal-format png --max-size 1064 --num-tokens 1200
python -m pip install numpy scipy pillow
python scripts/geometry/prepare.py .\dataset --eval-split-every 8
brush-cli .\dataset --eval-split-every 8

Preparation uses the training views to write depth-calibration.json and the matching PNGs in free-space/. Use the same evaluation split in both commands, or omit it in both to train on all registered views. Use the complete registered image set for this workflow. Frame subsampling or limiting frames changes which views belong to the evaluation split. To change the split, prepare a fresh copy. Brush defaults to RGB training on ordinary datasets and enables the three losses when it finds the calibration manifest in the dataset root (--geometry-supervision auto). on enables all three by default; off disables all three even if individual switches are true. In auto or on, an explicit individual switch overrides the default for that loss.

Each loss can now be enabled or disabled independently, with a separate nonnegative finite weight for experiments. The default enabled weights and the 500-step warm-up plus 500-step ramp are unchanged:

Switch (true / false) Weight option Default weight Required supervision files
--geometry-orientation --geometry-orientation-weight 0.05 depths/, normals/
--geometry-free-space --geometry-free-space-weight 0.02 depth-calibration.json, free-space/
--geometry-depth-distortion --geometry-depth-distortion-weight 0.01 None

For example, test lower orientation and depth-dispersion weights while keeping the free-space loss unchanged:

brush-cli.exe .\dataset --geometry-supervision on `
  --geometry-orientation true --geometry-orientation-weight 0.025 `
  --geometry-free-space true --geometry-free-space-weight 0.02 `
  --geometry-depth-distortion true --geometry-depth-distortion-weight 0.005

These are experimental overrides, not new defaults. A false switch or zero weight skips the corresponding loss and its additional rendering work. Setting a weight does not by itself enable a loss. To train with only depth dispersion on an ordinary undistorted PINHOLE dataset, use --geometry-depth-distortion true; no MoGe maps or calibration manifest are needed with the other losses left off in auto. Orientation alone does not require calibrated free-space files, and free-space alone does not require loading normals. Geometry training retains the existing PINHOLE camera requirement. The effective loss weights are reported in the INFO log after the final configuration is resolved. All six options also work in args.txt, with explicitly supplied CLI values taking precedence.

For fork development, see upstream maintenance and geometry regression testing. The geometry implementation is kept in focused modules, with a reproducible local GPU smoke test for the CLI switches, sidecars, and final exports.

Viewer

Brush also works well as a splat viewer, including on the web. It can load .ply & .compressed.ply files. You can stream in data from a URL (for a web app, simply append ?url=).

Brush also can load .zip of splat files to display them as an animation, or a special ply that includes delta frames (see cat-4D and Cap4D!).

CLI

Brush can be used as a CLI. Run brush --help to get an overview. Every CLI command can work with --with-viewer which also opens the UI, for easy debugging.

CLI diagnostics (OOOBrush fork)

For subprocess consumers, completed training updates also produce Training progress: iteration=… total=… elapsed_secs=… lod=… at INFO. Output is throttled to once per second, with immediate first, LOD-change and final reports. The total includes LOD steps and uses the merged configuration. These host-side reports reuse TrainStep; they add no GPU synchronization or loss readback. A final step report does not establish process/export success. Consumers must still check the exit status and output file.

Enable INFO logs before starting either headless binary. In PowerShell, for example:

$env:RUST_LOG = 'info'
$env:RUST_BACKTRACE = '1'
.\target\release\brush-cli.exe .\dataset --total-train-iters 10
# Alternatively, use the Brush application's headless entrypoint:
.\target\release\brush.exe .\dataset --total-train-iters 10

The existing RUST_LOG filter is respected; no default INFO or TRACE filter is added. Logs on stdout include the Brush version, GPU initialization and actual adapter information, final settings after merging args.txt and CLI arguments, loading/initialization durations, the first training step, and checkpoint export results. Stage timings measure host elapsed time without adding GPU synchronization. Existing progress, splat-count and evaluation output remains available. Errors and Rust panics retain their original context and stderr output; RUST_BACKTRACE=1 enables Rust backtraces. A missing stage completion helps locate a panic, but does not identify its GPU cause. Training completion does not imply every export succeeded: export failures remain warnings.

OOOSplat captures stdout/stderr, but its default filter mainly enables cubecl_wgpu/burn_wgpu. To also capture these Brush diagnostics, supply RUST_LOG=info, or append brush_cli=info,brush_process=info to the existing filter while retaining its GPU directives. This fork does not change OOOSplat's filter. Empty adapter/driver information is reported as unknown; total VRAM is not queried. Diagnostic summaries omit absolute export directories, but original error messages and existing logs may contain paths. These diagnostics do not fix the underlying GPU crashes reported in OOOSplat #23/#40.

Builds and releases (OOOBrush fork)

The CLI diagnostics, builds and releases workflow checks pull requests and pushes to main without publishing. It tests diagnostics without a GPU and builds Windows x64, Linux x64 and macOS ARM64 artifacts containing both brush-cli and brush (with .exe on Windows), README, LICENSE, BUILDINFO.json (source commit and actual binary versions), and internal SHA-256 checksums. Actions artifacts remain available for 14 days. Extract the Windows ZIP or Unix tar.gz inside the platform artifact. Builds are unsigned, macOS is not notarized, and hosted-runner tests do not exercise GPU training.

To publish, push a fork release tag after committing the desired code:

git tag ooo-v1.0.0
git push origin ooo-v1.0.0

Alternatively, open the workflow's Run workflow form, choose a branch and enter the required release_tag, such as ooo-v1.0.0 or ooo-v1.0.0-rc.1. An existing tag builds that exact tag; a new tag builds the selected branch's run commit and is created at that SHA by the publish job. These commands are examples, not a claim that this version has already been released. Tags use ooo-vMAJOR.MINOR.PATCH; a prerelease suffix automatically marks the Release as a prerelease.

Only after checks and all three builds succeed does the workflow create a draft, upload all three packages plus an external SHA256SUMS, download and verify the attachments, and publish to OOOBrush Releases. A failed upload/verification leaves a draft that the same-tag, same-commit run can resume. Already public Releases are never overwritten; use a new version tag. Manual and automatic runs for the same tag share a concurrency group and do not cancel active publication. The workflow uses GITHUB_TOKEN, with contents: write only in the publish job; repository policy must permit Release creation.

Merge workflow changes into main before publishing. GitHub can reject tag/Release creation with GITHUB_TOKEN when the selected commit changes workflow files relative to the default branch; such errors fail the job and leave any draft unpublished.

For OOOSplat, use brush-cli.exe on Windows or brush-cli on Linux/macOS. Verify the downloaded archive against the Release's external SHA256SUMS; the extracted package also includes checksums for its files. The existing cargo-dist Release workflow handles other version tags and excludes ooo-v*. Preserve that exclusion if regenerating its workflow.

Rerun

rerun_dash_compressed.mp4

While training, additional data can be visualized with the excellent rerun. To install rerun on your machine, please follow their instructions. Open the ./brush_blueprint.rbl in the viewer for best results.

Building Brush

First install rust 1.88+. You can run tests with cargo test --all. Brush uses the wonderful rerun for additional visualizations while training, run cargo install rerun-cli if you want to use it.

Windows/macOS/Linux

Use cargo run --release from the workspace root to make an optimized build. Use cargo run to run a debug build.

Web

Brush can be compiled to WASM. Run npm run dev to start the demo website using Next.js, see the web directory in app/brush-app/web.

Brush uses wasm-pack to build the WASM bundle. You can also use it without a bundler, see wasm-pack's documentation.

WebGPU is still an upcoming standard, and as such, only Chrome 134+ on Windows and macOS is currently supported.

Android

As a one time setup, make sure you have the Android SDK & NDK installed.

  • Check if ANDROID_NDK_HOME and ANDROID_HOME are set
  • Add the Android target to rust rustup target add aarch64-linux-android
  • Install cargo-ndk to manage building a lib cargo install cargo-ndk

Each time you change the rust code, run

  • cargo ndk -t arm64-v8a -o crates/brush-app/app/src/main/jniLibs/ build
  • Nb: Nb, for best performance, build in release mode. This is separate from the Android Studio app build configuration.
  • cargo ndk -t arm64-v8a -o crates/brush-app/app/src/main/jniLibs/ build --release

You can now either run the project from Android Studio (Android Studio does NOT build the rust code), or run it from the command line:

./gradlew build
./gradlew installDebug
adb shell am start -n com.splats.app/.MainActivity

You can also open this folder as a project in Android Studio and run things from there. Nb: Running in Android Studio does not rebuild the rust code automatically.

Benchmarks

Rendering and training are generally faster than gsplat. You can run benchmarks of some of the kernels using cargo bench.

Acknowledgements

gSplat, for their reference version of the kernels

Peter Hedman, George Kopanas & Bernhard Kerbl, for the many discussions & pointers.

The Burn team, for help & improvements to Burn along the way

Raph Levien, for the original version of the GPU radix sort.

GradeEterna, for feedback and their scenes.

Disclaimer

This is not an official Google product. This repository is a forked public version of the google-research repository

About

A maintained Brush fork for OOOSplat.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages