Models · Semantic segmentation
Sapiens segmentation
Meta's Sapiens: segmentation of human body parts (28 Goliath classes such as face, hair, limbs and clothing). Non-commercial licence.
Commercial use: no (code: CC-BY-NC-4.0 (noncommercial); weights: CC-BY-NC-4.0).
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
sapiens-seg-0.3b-goliath | synthetic (1024x2048) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 466 173 132 92.6 118 156 | 3673 / 4104 2520 / 2724 1643 / 1762 1643 / 1762 1373 / 1462 1564 (engine) |
sapiens-seg-1b-goliath | synthetic (1024x2048) | original (fp32) original portable kernels | 1189 354 275 185 | 6874 / 7284 5721 / 5906 3259 / 3384 3259 / 3382 |
Details
- Original code: https://github.com/facebookresearch/sapiens at
2cb07227a740 - Code licence: CC-BY-NC-4.0 (noncommercial); files:
LICENSE - Weights licence: CC-BY-NC-4.0
- Licence evidence: https://huggingface.co/facebook/sapiens-seg-1b-torchscript/blob/584504252a6d2a27ea6560927811db734ee42332/README.md
- Training data: MAE pretraining on Humans-300M (Meta-internal, not released); segmentation fine-tuning on Goliath body-part annotations (Meta, not released)
- Kernel libraries:
fastbb,cudnn_hacc,seg_up - Variants:
sapiens-seg-0.3b-goliath,sapiens-seg-1b-goliath - Outputs: logits; label_set:
goliath-28 - Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
sapiens-seg-0.3b-goliath3000x4000 (2.2 GiB peak allocated, 3.2 reserved);sapiens-seg-1b-goliath3000x4000 (3.8 GiB peak allocated, 5.0 reserved) sapiens-seg-0.3b-goliath1024x2048, first call: portable + torch.compile 12 s (cold Inductor cache), TensorRT fp16 53 s (ONNX + engine).sapiens-seg-0.3b-goliathoriginal 1024x2048: torch.autocast(fp16) around the forwardsapiens-seg-1b-goliathoriginal 1024x2048: torch.autocast(fp16) around the forwardsapiens-seg-0.3b-goliathload / first call: original 4.92 s / 1.024 s (512x512), portable 1.22 s / 0.132† s, kernels 0.96† s / 0.092† ssapiens-seg-1b-goliathload / first call: original 11.33 s / 0.569 s (512x512), portable 3.54 s / 0.274† s, kernels 2.27† s / 0.18† s- † measured in the speed sweep after the portable load (or an earlier size) in the same process: file cache and kernels are warm, so the time is lower than a fresh start.
- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5 (tools/speed_check.py), synthetic CUDA input (bench_inputs); peak = max over the first call and the timed calls
Measured
Any body part counts as person; ground truth = the COCO person masks. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
sapiens-seg-0.3b-goliath | COCO val2017 persons, every 10th image, person IoU % | 32.60 | 32.61 | 32.61 | 32.62 | |
sapiens-seg-1b-goliath | COCO val2017 persons, every 10th image, person IoU % | 54.22 | 54.22 | 54.22 | 54.19 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.05 and p99 <= 0.25 (absolute error of the output logits).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
sapiens-seg-0.3b-goliath | 0.00478 / 0.01673 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fastbb@7d058322634d:sm_120, seg_up@3e44e71200cd:sm_120 |
sapiens-seg-1b-goliath | 0.00819 / 0.03064 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fastbb@7d058322634d:sm_120, seg_up@3e44e71200cd:sm_120 |