Sapiens2 normals
Meta's Sapiens2 (2026): surface normals of people from one image (background normals are not meaningful). Custom Sapiens2 licence with use restrictions (commercial use allowed, not in the commercial pack).
experimental Fork of facebookresearch/sapiens2@7e5bae8 · backends: portable, kernels
- Paper Sapiens2 ICLR 2026 · first released 24 Apr 2026
Paper 2026 Added in 0.4.0 Evaluated with 0.4.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import depth
model = depth.load("sapiens2-normal-0.4b") # fastest backend that runs here
result = model("photo.jpg")
# result fields: normals
normals = result.normals # a torch tensor
arrays = result.numpy() # the tensor fields as NumPy arrays: arrays["normals"]
result.backend # what ran: mode, device, dtype
Other ways to run it
- Backend:
depth.load("sapiens2-normal-0.4b", mode="kernels") # or "portable", "auto" (default) - Precision:
depth.load("sapiens2-normal-0.4b", dtype="float32") # full precision: slower, portable only
fastforks bench sapiens2-normal-0.4b Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build), fp32, TF32 off | fp32 | 659 | 0.27× | 3,991 MiB/4,306 MiB | 3.0 | 0.88 |
| Original (own default)facebookresearch/sapiens2@7e5bae88456a config model under torch.autocast bfloat16 (no authors' flag) | bf16 | 178 | – | 3,234 MiB/4,306 MiB | 3.0 | 0.34 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 159 | 1.1× | 1,432 MiB/1,900 MiB | 0.7 | 0.31 |
| Kernels | fp16 | 137 | 1.3× | 1,422 MiB/1,560 MiB | 1.2 | 0.15 |
| Portable + torch.compile | not measured here | – | – | – | – | |
| TensorRT | not measured here | – | – | – | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-28 to 2026-12-02. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Load / first call (s) | Output vs reference | Input |
|---|---|---|---|---|---|---|---|
| Apple silicon runs on macOS | |||||||
| Apple M1 Pro 16 GB (MLX, fp16) MLX, torch 2.14.1, 2026-11-30 | Portable | fp16 | 1362 | 3,472 MiB process | 8.2 / 2.3 | skip | 1024x768 |
| Portable | fp32 | 2012 | 5,633 MiB process | 12.3 / 4.2 | skip | 1024x768 | |
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use unclear
- Code
- LicenseRef-Sapiens2-License LICENSE
- Weights
- other source
- Training data
- Pretraining on Humans-1B (Meta-internal, not released); normal fine-tuning on rendered people (Meta's MetaSim and RenderPeople scans; not released).
- weights: other
- Sapiens2 License (custom, Meta): commercial use allowed, but with use restrictions (no surveillance, biometric identification, deepfakes, inferring sensitive attributes, military use); redistribution must include the licence. https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md
Our reading of the licences, not legal advice.
Weights
sapiens2_0.4b_normal.safetensors 1.8 GB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download sapiens2-normal-0.4b).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
NYUv2 test normals
mean / median angle deg, % < 11.25 / < 30 deg
| Run | dtype | ang_mean ↓ | ang_median ↓ | a11.25 ↑ | a30 ↑ | images | ms / image |
|---|---|---|---|---|---|---|---|
| Original fp32 | not measured | ||||||
| Original fp16 | not measured | ||||||
| Portable fp32 | fp32 | 35.73 | 33.19 | 14.38 | 48.00 | 654 | 544 |
| Portable | fp16 | 35.74 | 33.20 | 14.37 | 47.99 | 654 | 158 |
| Kernels | not measured | ||||||
The original code was not run on this dataset, so the table cannot show the distance to it.
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Normals: angle to the ground-truth normal over the pixels with ground truth (Marigold's evaluation sets), mean over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
iBims-1 normals
mean / median angle deg, % < 11.25 / < 30 deg
| Run | dtype | ang_mean ↓ | ang_median ↓ | a11.25 ↑ | a30 ↑ | images | ms / image |
|---|---|---|---|---|---|---|---|
| Original fp32 | not measured | ||||||
| Original fp16 | not measured | ||||||
| Portable fp32 | fp32 | 27.25 | 20.45 | 32.16 | 67.24 | 100 | 544 |
| Portable | fp16 | 27.25 | 20.45 | 32.16 | 67.24 | 100 | 158 |
| Kernels | not measured | ||||||
The original code was not run on this dataset, so the table cannot show the distance to it.
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.01 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.003 and p99 <= 0.01 (absolute error of the output normals).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.01 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.003 | 0.00043 |
| GPU default dtypes, p99 |diff| | ≤ 0.01 | 0.00207 |
Recorded for sapiens2-normal-0.4b on RTX 5060 Ti, torch 2.14.1+cu130, 2026-12-02, with these kernels: sapiens2_opsswiglu
Details
Sapiens2 (Meta 2026) surface normals of people: a ViT with RoPE, grouped-query attention and SwiGLU, pretrained on 1 B human images, fine-tuned with a PixelShuffle upsampling head on rendered humans; 1024 x 768 input (aspect ratio kept, padded), normals at the image size.
- Input / output
- Input: one RGB image. Output: a depth or inverse-depth map.
What the numbers mean, and which models need the camera focal length
kind(a card field,result.kind) says what the numbers mean:metric= metres;scale_invariant,affine_invariant,affine_invariant_log(log depth) andaffine_invariant_inverseare relative (unknown scale or shift, not metres). Metric models that use the focal length takemodel(image, intrinsics=K)(K[3, 3], pixels of the input):metric3d-vit-largeandda3metric-largeneed it for correct metres (da3metric-large: metres = output x focal / 300; withoutintrinsics=a 300 px focal length is assumed, wrong for a real camera).unidepth-v2-vitl14,unik3d-vitl,depth-proand MoGe estimate the camera themselves (givenintrinsics=replacefx);zoedepth-nkand the relative models (da3mono-largetoo) take none. Normals-only models (kindnone) returnresult.normals[B, H, W, 3](unit vectors, camera frame: x right, y down, z forward). - Input size
- any H x W >= 1, resized or padded inside the model; tested up to 3000x4000 (1,526 MiB allocated)
- Outputs
normals- Checkpoint
embed_dim=1024,depth=24,num_heads=16- CUDA kernels
sapiens2_opsswiglu
Limitations
- Custom licence with use restrictions: not in the commercial selection (FASTFORKS_COMMERCIAL_ONLY, commercial ComfyUI pack).
- Trained on people only: normals of the background are not meaningful; mask them, e.g. with sapiens2-seg (class 0 = background).
- Every image is resized into 1024 x 768 (aspect ratio kept, padded; upstream test protocol); crop to the person first for small people.
- fp16 CUDA kernels (shared with Sapiens2 segmentation). Apple MLX: a hand-written network (shared Sapiens2 backbone, channels-last head); the resize, padding and normalisation stay on torch.
Full reference, generated from the repository
Meta's Sapiens2 (2026): surface normals of people from one image (background normals are not meaningful). Custom Sapiens2 licence with use restrictions (commercial use allowed, not in the commercial pack).
Commercial use: unclear (treat as no) (weights: other).
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
sapiens2-normal-0.4b | COCO val2017 000000003156.jpg (one person) resized to the input size (2048x1536) | original (fp32) original portable kernels | 659 178 159 137 | 3991 / 4306 3234 / 4306 1432 / 1900 1422 / 1560 |
sapiens2-normal-0.4b | COCO val2017 000000003156.jpg (one person) resized to the input size (1024x768) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 658 177 158 136 127 280 | 3991 / 4290 3235 / 4306 1405 / 1900 1396 / 1540 1322 / 1360 2324 / 2360 |
sapiens2-normal-1b | COCO val2017 000000003156.jpg (one person) resized to the input size (2048x1536) | original (fp32) original portable kernels | 1753 440 374 327 | 8578 / 9914 9461 / 9914 3504 / 4156 3494 / 3626 |
sapiens2-normal-1b | COCO val2017 000000003156.jpg (one person) resized to the input size (1024x768) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 1752 439 373 326 318 394 | 8578 / 9276 9461 / 9914 3477 / 4156 3467 / 3586 3394 / 3524 6444 / 6492 |
Details
- Original code: https://github.com/facebookresearch/sapiens2 at
7e5bae88456a - Code licence: LicenseRef-Sapiens2-License (permissive); files:
LICENSE - Weights licence: other
- Licence evidence: https://huggingface.co/facebook/sapiens2-normal-0.4b/blob/52886591372f049acd4d59ae6d0a792ae1a61ac5/README.md (license: other, license_name: sapiens2-license) ; https://github.com/facebookresearch/sapiens2/blob/7e5bae88456ac418ff0e58e74106c9fe192055d4/LICENSE.md
- Training data: Pretraining on Humans-1B (Meta-internal, not released); normal fine-tuning on rendered people (Meta's MetaSim and RenderPeople scans; not released).
- Licence note: Sapiens2 License (custom, Meta): commercial use allowed, but with use restrictions (no surveillance, biometric identification, deepfakes, inferring sensitive attributes, military use); redistribution must include the licence. https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md
- Kernel libraries:
sapiens2_ops,swiglu - Variants:
sapiens2-normal-0.4b,sapiens2-normal-1b - Outputs: normals; kind:
none - Input size: any H x W >= 1, resized or padded inside the model
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
sapiens2-normal-0.4b3000x4000 (1.5 GiB peak allocated, 1.9 reserved);sapiens2-normal-1b3000x4000 (3.5 GiB peak allocated, 4.0 reserved) sapiens2-normal-0.4b1024x768, first call: portable + torch.compile 26 s (cold Inductor cache), TensorRT fp16 66 s (ONNX + engine).sapiens2-normal-1b1024x768, first call: portable + torch.compile 38 s (cold Inductor cache), TensorRT fp16 120 s (ONNX + engine).sapiens2-normal-0.4boriginal (fp32) 2048x1536, original (fp32) 1024x768: facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build), fp32, TF32 offsapiens2-normal-0.4boriginal 2048x1536, original 1024x768: facebookresearch/sapiens2@7e5bae88456a config model under torch.autocast bfloat16 (no authors' flag)sapiens2-normal-1boriginal (fp32) 2048x1536, original (fp32) 1024x768: facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build), fp32, TF32 offsapiens2-normal-1boriginal 2048x1536, original 1024x768: facebookresearch/sapiens2@7e5bae88456a config model under torch.autocast bfloat16 (no authors' flag)sapiens2-normal-0.4bload / first call: original 2.97 s / 0.345 s (2048x1536), portable 0.65 s / 0.313 s (2048x1536), kernels 1.23 s / 0.206 s (1024x768)sapiens2-normal-1bload / first call: original 3.88 s / 0.591 s (2048x1536), portable 1.29 s / 0.478 s (2048x1536), kernels 40.73 s / 0.462 s (1024x768)- Protocol, median of 20 after 3 warm-ups, batch 1, unit normals at the image size; upstream: config test_pipeline + data_preprocessor on the host (not timed), then the network + resize on the GPU; fastforks: float CUDA image in, its own resize on the GPU; peak = one call after the warm-ups (weights included); load / first call: per process (first call at 1024x768)
Measured
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Normals: angle to the ground-truth normal over the pixels with ground truth (Marigold's evaluation sets), mean over images. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | portable | portable fp32 | note |
|---|---|---|---|---|
sapiens2-normal-0.4b | NYUv2 test normals, mean / median angle deg, % < 11.25 / < 30 deg | 35.74 / 33.20 / 14.37 / 47.99 | 35.73 / 33.19 / 14.38 / 48.00 | |
sapiens2-normal-0.4b | iBims-1 normals, mean / median angle deg, % < 11.25 / < 30 deg | 27.25 / 20.45 / 32.16 / 67.24 | 27.25 / 20.45 / 32.16 / 67.24 | |
sapiens2-normal-1b | NYUv2 test normals, mean / median angle deg, % < 11.25 / < 30 deg | 40.73 / 39.46 / 9.94 / 37.81 | 40.74 / 39.47 / 9.93 / 37.79 | |
sapiens2-normal-1b | iBims-1 normals, mean / median angle deg, % < 11.25 / < 30 deg | 23.03 / 15.12 / 42.68 / 75.16 | 23.03 / 15.12 / 42.68 / 75.16 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks f0b2da70d, 2026-11-30.
Parity
CPU, float32: max |diff| <= 0.01 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.003 and p99 <= 0.01 (absolute error of the output normals).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
sapiens2-normal-0.4b | 0.00043 / 0.00207 | RTX 5060 Ti, torch 2.14.1+cu130 | sapiens2_ops@20cfca7e340c:sm_120, swiglu@25fe34a2d389:sm_120 |
sapiens2-normal-1b | 0.00055 / 0.00238 | RTX 5060 Ti, torch 2.14.1+cu130 | sapiens2_ops@20cfca7e340c:sm_120, swiglu@25fe34a2d389:sm_120 |
Limitations
- Custom licence with use restrictions: not in the commercial selection (FASTFORKS_COMMERCIAL_ONLY, commercial ComfyUI pack).
- Trained on people only: normals of the background are not meaningful; mask them, e.g. with sapiens2-seg (class 0 = background).
- Every image is resized into 1024 x 768 (aspect ratio kept, padded; upstream test protocol); crop to the person first for small people.
- fp16 CUDA kernels (shared with Sapiens2 segmentation). Apple MLX: a hand-written network (shared Sapiens2 backbone, channels-last head); the resize, padding and normalisation stay on torch.
Example output
No example rendered for this checkpoint yet.