On-device
dichotomous image segmentation
running
fully on the LiteRT
CompiledModel
GPU
delegate (no CPU fallback).
DIS
(ECCV 2022) is a
high-accuracy IS-Net that cuts out the main object with
fine structure detail
(thin
stems, petals, wires, handles) — for e-commerce product photos and graphics. ~11 ms/frame
on a Pixel 8a.
Output:
[1, 1, 1024, 1024]
sigmoid mask (0–1) — resize to the image, use as alpha.
GPU conversion
DIS is a pure CNN (IS-Net RSU blocks). It converts fully GPU-compatible (
247/247 nodes
on the delegate, 1 partition
; device max|diff| 0.00034, ~11 ms) with
one defensive
patch
:
align_corners=True
→
False
on the bilinear upsamples. CPU-exact vs PyTorch
(max|diff| 0.0).
Minimal usage
Kotlin (Android, LiteRT CompiledModel GPU)
val options = CompiledModel.Options(Accelerator.GPU)
val model = CompiledModel.create(context.assets, "dis.tflite", options, null)
val inBufs = model.createInputBuffers()
val outBufs = model.createOutputBuffers()
inBufs[0].writeFloat(inputNCHW) // [1,3,1024,1024] RGB, x/255 - 0.5
model.run(inBufs, outBufs)
val mask = outBufs[0].readFloat() // [1024*1024] alpha (0..1); resize -> composite
Python (LiteRT / ai-edge-litert)
import numpy as np
from ai_edge_litert.interpreter import Interpreter
it = Interpreter(model_path="dis.tflite"); it.allocate_tensors()
inp, out = it.get_input_details(), it.get_output_details()
it.set_tensor(inp[0]["index"], x) # [1,3,1024,1024] float32, RGB, x/255 - 0.5
it.invoke()
mask = it.get_tensor(out[0]["index"])[0, 0] # [1024,1024] alpha 0..1
Conversion
Converted with
litert-torch
(
build_dis.py
): loads the Apache-2.0 IS-Net general-use
weights and exports the main mask.
DIS-ISNet-LiteRT huggingface.co is an AI model on huggingface.co that provides DIS-ISNet-LiteRT's model effect (), which can be used instantly with this litert-community DIS-ISNet-LiteRT model. huggingface.co supports a free trial of the DIS-ISNet-LiteRT model, and also provides paid use of the DIS-ISNet-LiteRT. Support call DIS-ISNet-LiteRT model through api, including Node.js, Python, http.
DIS-ISNet-LiteRT huggingface.co is an online trial and call api platform, which integrates DIS-ISNet-LiteRT's modeling effects, including api services, and provides a free online trial of DIS-ISNet-LiteRT, you can try DIS-ISNet-LiteRT online for free by clicking the link below.
litert-community DIS-ISNet-LiteRT online free url in huggingface.co:
DIS-ISNet-LiteRT is an open source model from GitHub that offers a free installation service, and any user can find DIS-ISNet-LiteRT on GitHub to install. At the same time, huggingface.co provides the effect of DIS-ISNet-LiteRT install, users can directly use DIS-ISNet-LiteRT installed effect in huggingface.co for debugging and trial. It also supports api for free installation.