Model card synced with fastforks 7204e33f
Browse files
README.md
CHANGED
|
@@ -62,6 +62,12 @@ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `patchmatchnet` 1988x2880 (7.9
|
|
| 62 |
| --- | --- | --- | --- | --- | --- | --- |
|
| 63 |
| `patchmatchnet` | 0.04 (1536x1024) | 0.06 (1536x1024) | 0.05† (1536x1024) | 0.92 (1536x1024) | 0.25 (1536x1024) | 0.04 (1536x1024) |
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
### Fixed-size speed and peak memory, all models
|
| 66 |
|
| 67 |
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|
|
@@ -77,17 +83,16 @@ Hardware, protocol and caveats: [benchmarks](https://github.com/kleinicke/fastfo
|
|
| 77 |
|
| 78 |
### Parity with the original code
|
| 79 |
|
| 80 |
-
Every variant is checked against golden outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.5 % and p99 <= 3 % of the reference's median |value|.
|
| 81 |
|
| 82 |
## Usage
|
| 83 |
|
| 84 |
```python
|
| 85 |
from fastforks import multiview
|
| 86 |
|
| 87 |
-
model = multiview.load("patchmatchnet") #
|
| 88 |
-
result = model(["
|
| 89 |
-
result.depth # [
|
| 90 |
-
# calibrated MVS: model(views, intrinsics=K, cam_to_world=c2w), K [N, 3, 3], c2w [N, 4, 4]
|
| 91 |
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
|
| 92 |
```
|
| 93 |
|
|
@@ -96,3 +101,5 @@ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastfork
|
|
| 96 |
## Kernels backend
|
| 97 |
|
| 98 |
`multiview.load("patchmatchnet", mode="kernels")` runs our CUDA kernels (`patchmatchnet`). 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.
|
|
|
|
|
|
|
|
|
| 62 |
| --- | --- | --- | --- | --- | --- | --- |
|
| 63 |
| `patchmatchnet` | 0.04 (1536x1024) | 0.06 (1536x1024) | 0.05† (1536x1024) | 0.92 (1536x1024) | 0.25 (1536x1024) | 0.04 (1536x1024) |
|
| 64 |
|
| 65 |
+
### torch.compile and TensorRT
|
| 66 |
+
|
| 67 |
+
| 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) |
|
| 68 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 69 |
+
| `patchmatchnet` | 1536x1024 | 201.66 | 175.0 | 29.4 | 28.2 | 54 | 29.57 | 1806 / 2096 | 1798 / 1888 | 790 |
|
| 70 |
+
|
| 71 |
### Fixed-size speed and peak memory, all models
|
| 72 |
|
| 73 |
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|
|
|
|
| 83 |
|
| 84 |
### Parity with the original code
|
| 85 |
|
| 86 |
+
Every variant is checked against golden outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.5 % and p99 <= 3 % of the reference's median |value| (absolute error of the output `depth`).
|
| 87 |
|
| 88 |
## Usage
|
| 89 |
|
| 90 |
```python
|
| 91 |
from fastforks import multiview
|
| 92 |
|
| 93 |
+
model = multiview.load("patchmatchnet") # mode="auto": the preferred backend from recorded measurements
|
| 94 |
+
result = model(["ref.jpg", "src1.jpg", "src2.jpg"], intrinsics=K, cam_to_world=c2w, depth_range=(0.5, 5.0))
|
| 95 |
+
result.depth # [1, H, W] float32 tensor; views[0] = reference, K [N, 3, 3] pixels, c2w [N, 4, 4] OpenCV
|
|
|
|
| 96 |
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
|
| 97 |
```
|
| 98 |
|
|
|
|
| 101 |
## Kernels backend
|
| 102 |
|
| 103 |
`multiview.load("patchmatchnet", mode="kernels")` runs our CUDA kernels (`patchmatchnet`). 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.
|
| 104 |
+
|
| 105 |
+
<!-- staged from fastforks 7204e33f (2026-11-05) -->
|