Commit ·
2e380cf
0
Parent(s):
fastforks 0.1.0
Browse files- .gitattributes +35 -0
- README.md +108 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: "fastforks"
|
| 3 |
+
pipeline_tag: "image-segmentation"
|
| 4 |
+
license: "other"
|
| 5 |
+
license_name: "mixed-see-variant-table"
|
| 6 |
+
license_link: "https://huggingface.co/tue-mps/ade20k_semantic_eomt_large_512/blob/aeb262f5a0bc609236d27f1277c3173ce57aeb27/README.md"
|
| 7 |
+
tags:
|
| 8 |
+
- "segmentation"
|
| 9 |
+
- "semantic-segmentation"
|
| 10 |
+
- "cuda"
|
| 11 |
+
- "pytorch"
|
| 12 |
+
- "fastforks"
|
| 13 |
+
---
|
| 14 |
+
# EoMT (fastforks)
|
| 15 |
+
|
| 16 |
+
EoMT (Kerssies et al. 2025): encoder-only mask transformer, a plain ViT-L/16 whose last blocks also carry the mask queries; DINOv2 or DINOv3 pre-training, semantic ADE20K checkpoints.
|
| 17 |
+
|
| 18 |
+
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/huggingface/transformers> at `c4c4605f9618`.
|
| 19 |
+
|
| 20 |
+
Author weight repos: <https://huggingface.co/tue-mps/ade20k_semantic_eomt_large_512>, <https://huggingface.co/tue-mps/eomt-dinov3-ade-semantic-large-512>.
|
| 21 |
+
|
| 22 |
+
Task: segmentation. Tier: stable. Outputs: `logits`. Backends: `portable`, `kernels`.
|
| 23 |
+
|
| 24 |
+
Input: one RGB image. Output: per-pixel class labels (logits with `logits=True`).
|
| 25 |
+
|
| 26 |
+
## Variants
|
| 27 |
+
|
| 28 |
+
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/segmentation/models/eomt/card.toml).
|
| 29 |
+
|
| 30 |
+
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|
| 31 |
+
|---|---|---|---|---|
|
| 32 |
+
| `eomt-l-dinov2-ade20k@1` | [eomt-l-dinov2-ade20k.config.json](https://huggingface.co/tue-mps/ade20k_semantic_eomt_large_512/resolve/aeb262f5a0bc609236d27f1277c3173ce57aeb27/config.json)<br>[eomt-l-dinov2-ade20k.safetensors](https://huggingface.co/tue-mps/ade20k_semantic_eomt_large_512/resolve/aeb262f5a0bc609236d27f1277c3173ce57aeb27/model.safetensors) | `5b11b6c2cc74`<br>`715f374b2bc9` | MIT | yes |
|
| 33 |
+
| `eomt-l-dinov3-ade20k@1` | [eomt-l-dinov3-ade20k.config.json](https://huggingface.co/tue-mps/eomt-dinov3-ade-semantic-large-512/resolve/1d1f172700ab69371df7afe778fe133fff7dd521/config.json)<br>[eomt-l-dinov3-ade20k.safetensors](https://huggingface.co/tue-mps/eomt-dinov3-ade-semantic-large-512/resolve/1d1f172700ab69371df7afe778fe133fff7dd521/model.safetensors) | `a06117034714`<br>`319c72ee001f` | MIT AND LicenseRef-DINOv3-License | yes |
|
| 34 |
+
|
| 35 |
+
## Licence
|
| 36 |
+
|
| 37 |
+
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Files: .
|
| 38 |
+
|
| 39 |
+
Training data: LVD-142M (DINOv2's curated web-image set, not released), ADE20K (SceneParsing, 150 classes).
|
| 40 |
+
|
| 41 |
+
- Licence note: The eomt-l-dinov3-ade20k checkpoint is fine-tuned from DINOv3, so it also carries the DINOv3 License (redistribution must include its text); that licence does not exclude commercial use.
|
| 42 |
+
|
| 43 |
+
Licence evidence: <https://huggingface.co/tue-mps/ade20k_semantic_eomt_large_512/blob/aeb262f5a0bc609236d27f1277c3173ce57aeb27/README.md>
|
| 44 |
+
|
| 45 |
+
## Input size
|
| 46 |
+
|
| 47 |
+
any H x W >= 1, resized or padded inside the model
|
| 48 |
+
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `eomt-l-dinov2-ade20k` 3000x4000 (14.5 GiB peak allocated, 14.7 reserved); `eomt-l-dinov3-ade20k` 3000x4000 (14.5 GiB peak allocated, 14.7 reserved)
|
| 49 |
+
|
| 50 |
+
## Speed and memory
|
| 51 |
+
|
| 52 |
+
### Segmentation, synthetic, 1024x2048
|
| 53 |
+
|
| 54 |
+
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|
| 55 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 56 |
+
| `eomt-l-dinov2-ade20k` | 178 | 63.7 | 50.8 | 35.0 | 1.8x | 1.5x | 3827 / 4086 | 1515 / 1584 | 1515 / 1584 |
|
| 57 |
+
| `eomt-l-dinov3-ade20k` | 186 | 72.1 | 54.6 | 38.8 | 1.9x | 1.4x | 3822 / 4086 | 1514 / 1584 | 1514 / 1584 |
|
| 58 |
+
|
| 59 |
+
### Startup and first call
|
| 60 |
+
|
| 61 |
+
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|
| 62 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 63 |
+
| `eomt-l-dinov2-ade20k` | 4.80 (512x512) | 3.13 | 3.27† | 0.54 (512x512) | 0.05 | 0.04† |
|
| 64 |
+
| `eomt-l-dinov3-ade20k` | 1.83 (512x512) | 3.20 | 3.24† | 0.07 (512x512) | 0.08 | 0.04† |
|
| 65 |
+
|
| 66 |
+
### torch.compile and TensorRT
|
| 67 |
+
|
| 68 |
+
| 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) |
|
| 69 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 70 |
+
| `eomt-l-dinov2-ade20k` | 1024x2048 | 50.8 | 50.8 | 0.3 | 54.3 | 53 | 35.0 | 1515 / 1584 | 1512 / 1604 | 1798 |
|
| 71 |
+
|
| 72 |
+
### Fixed-size speed and peak memory, all models
|
| 73 |
+
|
| 74 |
+
| model | mode | 480x640 | 720x1280 | 1080x1920 | 12 MP 3000x4000 |
|
| 75 |
+
| --- | --- | --- | --- | --- | --- |
|
| 76 |
+
| `eomt-l-dinov2-ade20k` | portable | 50.3 ms / 1917 / 2484 | 55.4 ms / 2412 / 3506 | 63.2 ms / 3417 / 4834 | 129.2 ms / 14890 / 15016 |
|
| 77 |
+
| `eomt-l-dinov2-ade20k` | kernels | 38.5 ms / 1917 / 2484 | 43.8 ms / 2412 / 3506 | 51.5 ms / 3417 / 4834 | 117.4 ms / 14890 / 15016 |
|
| 78 |
+
| `eomt-l-dinov3-ade20k` | portable | 54.2 ms / 1916 / 2486 | 59.2 ms / 2411 / 3502 | 67.0 ms / 3415 / 4836 | 133.1 ms / 14889 / 15016 |
|
| 79 |
+
| `eomt-l-dinov3-ade20k` | kernels | 42.5 ms / 1916 / 2486 | 47.7 ms / 2411 / 3502 | 55.3 ms / 3415 / 4836 | 121.2 ms / 14889 / 15016 |
|
| 80 |
+
|
| 81 |
+
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
|
| 82 |
+
|
| 83 |
+
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.
|
| 84 |
+
|
| 85 |
+
## Accuracy
|
| 86 |
+
|
| 87 |
+
### Parity with the original code
|
| 88 |
+
|
| 89 |
+
Every variant is checked against reference 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.0002 and p99 <= 0.003 (absolute error of the output `logits`).
|
| 90 |
+
|
| 91 |
+
## Usage
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
from fastforks import segmentation
|
| 95 |
+
|
| 96 |
+
model = segmentation.load("eomt-l-dinov2-ade20k") # mode="auto": the preferred backend from recorded measurements
|
| 97 |
+
result = model("photo.jpg")
|
| 98 |
+
result.labels # [H, W] per-pixel class index
|
| 99 |
+
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `eomt-l-dinov2-ade20k`, `eomt-l-dinov3-ade20k`.
|
| 103 |
+
|
| 104 |
+
## Kernels backend
|
| 105 |
+
|
| 106 |
+
`segmentation.load("eomt-l-dinov2-ade20k", mode="kernels")` runs our CUDA kernels (`fastbb`, `seg_up`). 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.
|
| 107 |
+
|
| 108 |
+
<!-- staged from fastforks feccac41 (2026-11-06) -->
|