File size: 5,916 Bytes
32cdcd9 6628c61 32cdcd9 6628c61 32cdcd9 6628c61 32cdcd9 6628c61 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | ---
library_name: "fastforks"
pipeline_tag: "depth-estimation"
license: "other"
license_name: "noncommercial-and-cc-by-nc-4.0"
license_link: "https://github.com/Junda24/MonSter-plusplus/blob/9167101af8fbe93c706707daa7a8181089c8b1b4/LICENSE#L34"
tags:
- "stereo"
- "stereo-matching"
- "disparity"
- "cuda"
- "pytorch"
- "fastforks"
---
# MonSter++ (fastforks)
MonSter++ (Cheng et al. 2025), accuracy model (the MonSter network, max disparity 416): Depth Anything V2 (ViT-L) monocular branch + IGEV-style geometry volume, with stereo and mono ConvGRUs that refine each other, 32 iterations.
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: <https://github.com/kleinicke/fastforks>. Kernels for the `kernels` backend: <https://huggingface.co/fastforks/kernels>. Original code: <https://github.com/Junda24/MonSter-plusplus> at `9167101af8fb`.
Author weight repos: <https://huggingface.co/cjd24/MonSter-plusplus>.
Task: stereo. Tier: experimental. Outputs: `disparity`. Backends: `portable`, `kernels`.
Input: a rectified left / right image pair. Output: a disparity map (pixels, left view).
## Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in [`card.toml`](https://github.com/kleinicke/fastforks/blob/main/src/fastforks/stereo/models/monster_plusplus/card.toml).
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
| `monster-plusplus-mix-all@1` | [Mix_all_large.pth](https://huggingface.co/cjd24/MonSter-plusplus/resolve/main/Mix_all_large.pth?download=true) | `e86dede921dc` | LicenseRef-noncommercial AND CC-BY-NC-4.0 | **no** |
## Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: LicenseRef-noncommercial. Files: `LICENSE`.
Training data: mix_all: 'all the datasets we collect over 2M image pairs' (README), not listed.
Licence evidence: <https://github.com/Junda24/MonSter-plusplus/blob/9167101af8fbe93c706707daa7a8181089c8b1b4/LICENSE#L34>
## Input size
any H x W >= 32, padded to a multiple of 32
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `monster-plusplus-mix-all` 1988x2880 (7.7 GiB peak allocated, 9.6 reserved)
## Speed and memory
### Stereo, Middlebury 2014 half, 994x1482
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `monster-plusplus-mix-all` | 4339.1 | 4334.5 | 1632.62 | 697.92 | 6.2x | 2.3x | 6382 / 6430 | 2583 / 2918 | 2438 / 2760 |
### Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
| --- | --- | --- | --- | --- | --- | --- |
| `monster-plusplus-mix-all` | 8.37 (375x1242) | 2.45 | 0.79† | 1.23 (375x1242) | 1.63† | 0.70† |
### torch.compile and TensorRT
| model | input | portable ms | compile ms | compile s (cold) | TensorRT fp16 ms | ONNX + build s | kernels ms | peak MiB (alloc / reserved): portable | compile | TensorRT (device) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `monster-plusplus-mix-all` | 994x1482 | 1632.62 | 1126.0 | 108.9 | fails: ONNX export: conversion failed | – | 697.92 | 2583 / 2918 | 2328 / 2532 | – |
### Fixed-size speed and peak memory, all models
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
| --- | --- | --- | --- | --- | --- |
| `monster-plusplus-mix-all` | portable | 294.3 ms / 1138 / 1246 | 928.8 ms / 1880 / 2318 | 2370.0 ms (n=3) / 3269 / 3812 | OOM |
| `monster-plusplus-mix-all` | kernels | 132.9 ms / 1130 / 1270 | 396.3 ms / 1804 / 2344 | 998.1 ms / 3051 / 3724 | OOM |
### Apple silicon (MPS)
| model | `portable` | `kernels` | speed-up |
| --- | --- | --- | --- |
| `monster-plusplus-mix-all` | 3518 ms / 3490 MiB (float16) | 2928 ms / 3492 MiB | 1.20x |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: [benchmarks](https://github.com/kleinicke/fastforks/blob/main/docs/benchmarks.md) (RTX 5060 Ti 16 GB, sm_120). Original = the authors' code at the precision of portable (fp16, or `(fp32)` where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
## Accuracy
### Parity with the original code
Every variant is checked against golden outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.2 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.03 px and p99 <= 0.25 px.
## Usage
```python
from fastforks import stereo
# non-commercial weights: run with FASTFORKS_NONCOMMERCIAL=1 in the environment
model = stereo.load("monster-plusplus-mix-all") # mode="auto": the preferred backend from recorded measurements
result = model("left.png", "right.png")
result.disparity # [H, W] float32 tensor, input resolution
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
```
Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `monster-plusplus-mix-all`.
## Kernels backend
`stereo.load("monster-plusplus-mix-all", mode="kernels")` runs our CUDA kernels (`igev`, `igevpp`, `cutlass_conv`, `cudnn_hacc`, `fastbb`). It needs a prebuilt kernel for your GPU architecture (downloaded from <https://huggingface.co/fastforks/kernels> on first use) and a recent NVIDIA driver; if there is none it raises `BackendUnavailableError` with the reason and never falls back silently. `mode="auto"` picks `kernels` when it can run and logs the choice.
<!-- staged from fastforks 7204e33f (2026-11-05) -->
|