IS-Net
IS-Net (ECCV 2022, the DIS benchmark's authors): cuts the foreground out of a photo as a fine mask at 1024 x 1024 (background removal); the authors' general-use model and the academic DIS5K one. Apache-2.0 code and weights.
experimental Fork of xuebinqin/DIS@b6764e2 · backends: portable, kernels
- Paper Highly Accurate Dichotomous Image Segmentation ECCV 2022 · first released 6 Mar 2022
Paper 2022 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import matting
model = matting.load("isnet-general-use") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.alpha
result.backend # what ran: mode, device, dtype, kernels fastforks bench isnet-general-use 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, 1080x1920 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original (own default)xuebinqin/DIS@b6764e20381f, float pre- and post-processing | fp32 | 38.5 | – | 993 MiB/1,042 MiB | 1.6 | 0.41 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 21.0 | 1.8× | 512 MiB/562 MiB | 0.2 | 0.29 |
| Kernels | fp16 | 12.1 | 3.2× | 487 MiB/522 MiB | 1.3 | 0.09 |
| Portable + torch.compile | 13.1 | 2.9× | 350 MiB/400 MiB | 34 (build) | – | |
| TensorRT fp16 | fp16 | 6.66 | 5.8× | 264 MiBenginenot comparable | 32 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-13. 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 | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 156 | 2,030 MiB process | – | 1080x1920 |
| Portable | fp16 | 130 | 1,746 MiB process | matches | 1080x1920 | |
| Portable | fp32 | 157 | 1,787 MiB process | matches | 1080x1920 | |
| Kernels | fp16 | not implemented | – | 1080x1920 | ||
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
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
-
- DIS5K (dichotomous image segmentation) noncommercial, non-commercial
Our reading of the licences, not legal advice.
Weights
isnet-general-use.pth 177 MB· hosted on Google Drivefastforks downloads and checks these files on first use (fastforks download isnet-general-use).
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.
DIS5K validation (DIS-VD)
every 2nd image (235), MAE / max F-beta
| Run | dtype | mae ↑ | max_fbeta ↑ | Δ mae vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.0157 | 0.9624 | reference | 235 | 41.4 |
| Original fp16 | not measured | |||||
| Portable fp32 | fp32 | 0.0157 | 0.9624 | ±0.0000 | 235 | 41.4 |
| Portable | fp16 | 0.0157 | 0.9624 | ±0.0000 | 235 | 24.6 |
| Kernels | fp16 | 0.0157 | 0.9624 | ±0.0000 | 235 | 15.2 |
Each image at its own size against its binary mask: MAE of the alpha, max F-beta (beta^2 = 0.3) over 256 thresholds (BiRefNet's evaluation). Original = the authors’ code, same checkpoint and protocol. Measured on original fp32: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 45a5c91f, 2026-11-13.
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.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.25 (absolute error of the output alpha).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.02 | 0.00006 |
| GPU default dtypes, p99 |diff| | ≤ 0.25 | 0.00028 |
Recorded for isnet-general-use on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: cudnn_hacccutlass_convigev
Details
IS-Net (Qin et al., ECCV 2022): dichotomous image segmentation, a U²-Net-style encoder-decoder of residual U-blocks at 1024 x 1024 (strided stem), trained with intermediate supervision. `isnet-general-use` is the authors' general-purpose model (rembg's `isnet-general-use`), `isnet` the academic DIS5K model.
- Input / output
- Input: one RGB image (trimap-guided models also a trimap: background / unknown / foreground). Output: an alpha matte
[H, W]in [0, 1] at the input size: 1 = foreground (background removal, dichotomous / salient object segmentation). - Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (918 MiB allocated)
- Outputs
alpha- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)igevIGEV stereo: convolution epilogues, correlation lookups, GRU gatescutlass_convCUTLASS convolutions with the recurrent update (GRU) fused in
- Apple (MPS)
- fp32, fp16
Full reference, generated from the repository
IS-Net (ECCV 2022, the DIS benchmark's authors): cuts the foreground out of a photo as a fine mask at 1024 x 1024 (background removal); the authors' general-use model and the academic DIS5K one. Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
isnet-general-use | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 38.5 21.0 12.1 13.1 6.66 | 993 / 1042 512 / 562 487 / 522 350 / 400 404 / 436 |
isnet | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 38.5 21.0 12.1 13.1 6.70 | 993 / 1042 512 / 562 487 / 522 350 / 400 404 / 436 |
Details
- Original code: https://github.com/xuebinqin/DIS at
b6764e20381f - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/xuebinqin/DIS/blob/b6764e20381f6f42a70f83fa3324181529ed1403/LICENSE.md ; https://github.com/xuebinqin/DIS/blob/b6764e20381f6f42a70f83fa3324181529ed1403/README.md
- Training data: DIS5K (dichotomous image segmentation) (README: the general-use model is "optimized ... for general use" (training data not named); isnet.pth is the academic model trained on DIS5K V1.0 (DIS-TR). DIS5K ships its own terms of use (DIS5K-Dataset-Terms-of-Use.pdf).)
- Kernel libraries:
cudnn_hacc,igev,cutlass_conv - Variants:
isnet-general-use,isnet - Outputs: alpha
- Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
isnet-general-use3000x4000 (0.9 GiB peak allocated, 1.0 reserved);isnet3000x4000 (0.9 GiB peak allocated, 1.0 reserved) isnet-general-use1080x1920, first call: portable + torch.compile 34 s (cold Inductor cache), TensorRT fp16 32 s (ONNX + engine).isnet1080x1920, first call: portable + torch.compile 34 s (cold Inductor cache), TensorRT fp16 34 s (ONNX + engine).isnet-general-useoriginal 1080x1920: xuebinqin/DIS@b6764e20381f, float pre- and post-processingisnetoriginal 1080x1920: xuebinqin/DIS@b6764e20381f, float pre- and post-processingisnet-general-useload / first call: original 1.58 s / 0.407 s, portable 0.24 s / 0.293 s, kernels 1.32 s / 0.087 sisnetload / first call: original 1.58 s / 0.409 s, portable 0.23 s / 0.338 s, kernels 1.54 s / 0.116 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
Each image at its own size against its binary mask: MAE of the alpha, max F-beta (beta^2 = 0.3) over 256 thresholds (BiRefNet's evaluation). Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|
isnet-general-use | DIS5K validation (DIS-VD), every 2nd image (235), MAE / max F-beta | 0.0157 / 0.9624 | 0.0157 / 0.9624 | 0.0157 / 0.9624 | 0.0157 / 0.9624 | |
isnet | DIS5K validation (DIS-VD), every 2nd image (235), MAE / max F-beta | 0.0768 / 0.7820 | 0.0768 / 0.7821 | 0.0768 / 0.7820 | 0.0768 / 0.7821 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 45a5c91f, 2026-11-13.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.25 (absolute error of the output alpha).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
isnet-general-use | 6e-05 / 0.00028 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120 |
isnet | 7e-05 / 0.00116 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120 |
Example output
No example rendered for this checkpoint yet.