Models · Semantic segmentation

BiSeNet face parsing

BiSeNet face parsing (Yu et al., ECCV 2018; zllrunning's face-parsing.PyTorch checkpoint as shipped by facexlib): labels skin, brows, eyes, glasses, ears, nose, mouth, lips, neck, cloth, hair and hat in a face crop (19 classes, CelebAMask-HQ). MIT code and weights.

experimental Fork of xinntao/facexlib@260620a · backends: portable, kernels

Checkpoint bisenet-face-parsing

Paper 2018 Added in 0.2.0

Portable, RTX 5060 Ti 16 GB 2.41 ms 512x512, fp16
vs the faster original 2.5× original fp16: 5.94 ms
Peak memory 51 MiB original: 69 MiB
Accuracy vs original fp32 – no test-set run

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import segmentation

model = segmentation.load("bisenet-face-parsing")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.logits
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench bisenet-face-parsing

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.

Input: synthetic, 512x512

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original fp16.half() on 1 modules, fp16 inputs; face-parsing.PyTorch test.py: PIL resize 512 x 512 on the CPU, Normalize, net(x)[0], float32fp16 5.94–69 MiB/94 MiB0.10.02
Portable fp32fp32not measured ––––
Portablefp16 2.412.5×51 MiB/72 MiB0.20.28
Kernelsnot measured ––––
Portable + torch.compile 1.344.4×76 MiB/110 MiB6 (build)–
TensorRT fp16fp16 0.6788.8×44 MiBenginenot comparable13 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-14. 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

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14Originalfp3223.7 1,466 MiB process–512x512
Portablefp1613.6 440 MiB processmatches512x512
Portablefp3215.8 1,434 MiB processmatches512x512
Kernelsfp32not implemented–512x512

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 allowed

Code
MIT LICENSE
Weights
MIT source
Training data

Our reading of the licences, not legal advice.

Weights

parsing_bisenet.pth 53.3 MB· hosted on GitHub

fastforks downloads and checks these files on first use (fastforks download bisenet-face-parsing).

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.

Accuracy not measured for bisenet-face-parsing.

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| <= 2.6e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0042 and p99 <= 0.02 (absolute error of the output logits).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.000026 not recorded
GPU default dtypes, mean |diff|≤ 0.0042 0.00292
GPU default dtypes, p99 |diff|≤ 0.02 0.01313

Recorded for bisenet-face-parsing on RTX 5060 Ti, torch 2.10.0+cu130, 2026-11-17, with these kernels: cudnn_hacccutlass_convigev

Details

BiSeNet (Yu et al. 2018) face parsing from face-parsing.PyTorch: a ResNet-18 context path with attention refinement and feature fusion, 19 CelebAMask-HQ face-part classes (skin, brows, eyes, glasses, ears, earrings, nose, mouth, lips, neck, necklace, cloth, hair, hat) on a 512 x 512 face crop. The parser that GFPGAN / CodeFormer pipelines use through facexlib; MIT code and weights.

Input / output
Input: one RGB image. Output: per-pixel class labels (logits with logits=True).
Input size
any H x W >= 1, resized or padded inside the model; tested up to 512x512 (51 MiB allocated)
Outputs
logits
CUDA kernels
  • igevIGEV stereo: convolution epilogues, correlation lookups, GRU gates
  • cutlass_convCUTLASS convolutions with the recurrent update (GRU) fused in
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
Apple (MPS)
fp32, fp16

Limitations

  • No accuracy measurement: face parsing is scored on CelebAMask-HQ, which is not part of the evaluation data here (no public mirror with a clear licence); tiers are compared by output parity and speed only.
Full reference, generated from the repository

BiSeNet face parsing (Yu et al., ECCV 2018; zllrunning's face-parsing.PyTorch checkpoint as shipped by facexlib): labels skin, brows, eyes, glasses, ears, nose, mouth, lips, neck, cloth, hair and hat in a face crop (19 classes, CelebAMask-HQ). MIT code and weights.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
bisenet-face-parsingsynthetic (512x512)original
portable
kernels
portable + torch.compile
TensorRT fp16
5.94
2.41
–
1.34
0.678
69 / 94
51 / 72
–
76 / 110
85 / 110
Details

Parity

CPU, float32: max |diff| <= 2.6e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0042 and p99 <= 0.02 (absolute error of the output logits).

variantkernels error vs original, mean / p99GPU, torchkernels used
bisenet-face-parsing0.00292 / 0.01313RTX 5060 Ti, torch 2.10.0+cu130cudnn_hacc@cudnn91501, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120

Limitations

  • No accuracy measurement: face parsing is scored on CelebAMask-HQ, which is not part of the evaluation data here (no public mirror with a clear licence); tiers are compared by output parity and speed only.

Example output

No example rendered for this checkpoint yet.