Model card synced with fastforks 7204e33f
Browse files
README.md
CHANGED
|
@@ -20,7 +20,7 @@ This repo is the model card only: it holds no weights. fastforks downloads the a
|
|
| 20 |
|
| 21 |
Task: depth. Tier: experimental. Outputs: `inverse_depth`. Backends: `portable`, `kernels`.
|
| 22 |
|
| 23 |
-
Input: one RGB image. Output: a depth or inverse-depth map (metric for the
|
| 24 |
|
| 25 |
## Variants
|
| 26 |
|
|
@@ -59,6 +59,12 @@ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `midas-dpt-beit-large-512` 300
|
|
| 59 |
| --- | --- | --- | --- | --- | --- | --- |
|
| 60 |
| `midas-dpt-beit-large-512` | 5.16 | 2.49 | 0.28† | 1.14 | 0.09 | 0.07 |
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
### Fixed-size speed and peak memory, all models
|
| 63 |
|
| 64 |
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|
|
@@ -89,14 +95,14 @@ Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-27.
|
|
| 89 |
|
| 90 |
### Parity with the original code
|
| 91 |
|
| 92 |
-
Every variant is checked against golden outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.02 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.5 % and p99 <= 2 % of the reference's median |value|.
|
| 93 |
|
| 94 |
## Usage
|
| 95 |
|
| 96 |
```python
|
| 97 |
from fastforks import depth
|
| 98 |
|
| 99 |
-
model = depth.load("midas-dpt-beit-large-512") #
|
| 100 |
result = model("room.jpg")
|
| 101 |
result.inverse_depth # [H, W] float32 tensor; result.kind says what the maps mean
|
| 102 |
# models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
|
|
@@ -108,3 +114,5 @@ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastfork
|
|
| 108 |
## Kernels backend
|
| 109 |
|
| 110 |
`depth.load("midas-dpt-beit-large-512", mode="kernels")` runs our CUDA kernels (`cudnn_hacc`). 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.
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
Task: depth. Tier: experimental. Outputs: `inverse_depth`. Backends: `portable`, `kernels`.
|
| 22 |
|
| 23 |
+
Input: one RGB image. Output: a depth or inverse-depth map. `kind` (a card field, `result.kind`) says what the numbers mean: `metric` = metres; `scale_invariant`, `affine_invariant` and `affine_invariant_inverse` are relative (unknown scale or shift, not metres). Metric models that use the focal length take `model(image, intrinsics=K)` (K `[3, 3]`, pixels of the input): `metric3d-vit-large` and `da3metric-large` need it for correct metres (`da3metric-large`: metres = output x focal / 300; without `intrinsics=` a 300 px focal length is assumed, wrong for a real camera). `unidepth-v2-vitl14`, `unik3d-vitl`, `depth-pro` and MoGe estimate the camera themselves (given `intrinsics=` replace `fx`); `zoedepth-nk` and the relative models (`da3mono-large` too) take none.
|
| 24 |
|
| 25 |
## Variants
|
| 26 |
|
|
|
|
| 59 |
| --- | --- | --- | --- | --- | --- | --- |
|
| 60 |
| `midas-dpt-beit-large-512` | 5.16 | 2.49 | 0.28† | 1.14 | 0.09 | 0.07 |
|
| 61 |
|
| 62 |
+
### torch.compile and TensorRT
|
| 63 |
+
|
| 64 |
+
| 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) |
|
| 65 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 66 |
+
| `midas-dpt-beit-large-512` | 994x1482 | 78.79 | fails: Dynamo: inference_mode in model code | – | 52.2 | 54 | 63.89 | 992 / 1418 | – | 800 |
|
| 67 |
+
|
| 68 |
### Fixed-size speed and peak memory, all models
|
| 69 |
|
| 70 |
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|
|
|
|
| 95 |
|
| 96 |
### Parity with the original code
|
| 97 |
|
| 98 |
+
Every variant is checked against golden outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.02 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.5 % and p99 <= 2 % of the reference's median |value| (absolute error of the output `inverse_depth`).
|
| 99 |
|
| 100 |
## Usage
|
| 101 |
|
| 102 |
```python
|
| 103 |
from fastforks import depth
|
| 104 |
|
| 105 |
+
model = depth.load("midas-dpt-beit-large-512") # mode="auto": the preferred backend from recorded measurements
|
| 106 |
result = model("room.jpg")
|
| 107 |
result.inverse_depth # [H, W] float32 tensor; result.kind says what the maps mean
|
| 108 |
# models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
|
|
|
|
| 114 |
## Kernels backend
|
| 115 |
|
| 116 |
`depth.load("midas-dpt-beit-large-512", mode="kernels")` runs our CUDA kernels (`cudnn_hacc`). 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.
|
| 117 |
+
|
| 118 |
+
<!-- staged from fastforks 7204e33f (2026-11-05) -->
|