Add withoutBG open ONNX alpha-matting / background-removal model to Inference
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- huggingface, numpy, python
Research direction
Start by reading the existing depth_estimation@v1 workflow and the model patterns in inference_models. Check how model registries, prediction tests, and letterboxing and unpadding tests are organized. Done means the withoutBG ONNX model has an agreed task and weight packaging, integration coverage, documentation, and required notices.
Written by the indexing model from the issue text.
Description
Search before asking
- I have searched the Inference issues and found no similar feature requests.
Description
I'd like to add withoutBG Open Weights as a foundation alpha matting / background removal model to inference / inference_models.
Model: https://huggingface.co/withoutbg/withoutbg-openweights-onnx
I'm the author and trainer of this model.
What it is
- Self-contained ONNX model (opset 18, ~455 MB, fp32)
- Pipeline combines Depth Anything V2 (embedded in the graph) with a ConvNeXt-based matting head built on a DINOv3 ConvNeXt backbone
- No trimap required. Takes an RGB image as input and produces a soft alpha matte
- Fixed 448×448 input using letterboxing. A sidecar JSON documents the input/output names, tensor shapes, and SHA-256 checksum
I/O contract
| Name | Shape | Dtype | Range | |
|---|---|---|---|---|
| Input | rgb |
[1, 3, 448, 448] |
float32 |
[0, 1] NCHW |
| Output | alpha |
[1, 1, 448, 448] |
float32 |
[0, 1] |
Pre/post-processing is straightforward:
- Letterbox the longest side to 448.
- Pad to the top left.
- Run the ONNX model.
- Remove the padding.
- Resize the alpha matte back to the original image size.
- Optionally produce an RGBA cutout.
Proposed integration (v1)
- Add an ONNX model class to
inference_modelswithfrom_pretrained, plus a registry entry under a new task such asimage-mattingorbackground-removal(happy to follow the maintainers' preference). - Add a workflow block modeled after
depth_estimation@v1that outputsalpha(NUMPY_ARRAY_KIND) together with an optional cutout or visualization image. - Add documentation, unit tests for letterboxing and unpadding, a prediction test, and the required license and third-party notices.
- Add an HTTP
/inferadapter later if it makes sense.
Licensing
- Model weights: Apache-2.0
- Third-party components:
- Depth Anything V2: Apache-2.0
- DINOv3: Meta's DINOv3 license, consistent with how DINOv3 classification models are already documented in this repository
Questions
- What task type would you prefer for the registry?
- How would you prefer to package the weights and assign model IDs? Roboflow model package or direct download from Hugging Face?
- Any concerns about shipping a fused ONNX model that includes DINOv3 ConvNeXt components?
I'm happy to put together the implementation once we're aligned on the above.
Use case
- Background removal (soft alpha, not a hard mask)
- Product & portrait isolation where fine details matter (hair, edges) and instance / semantic segmentation is not enough
- Image compositing (alpha + original -> cutout / new background)
Additional
See model outputs: https://withoutbg.com/open-model/results
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 340
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 92
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roboflow/inference
-
Allow Pillow 13 in inference-sdkMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
roboflow/inference#3335 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
roboflow/inference#3173 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
roboflow/inference#2993 · 2 comments ·
Maintainers usually reply within 1 day
-
Add context manager (__enter__ / __exit__) support to InferencePipelinePossibly taken @KushagraKanaujia claimed this 67 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
roboflow/inference#2744 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
roboflow/inference#1913 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
All issues in roboflow/inference
Similar issues
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
randomparity/kdive#3620 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FinanceFlash/unvibecode#760 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
google-research/google-research#3470 ·
Maintainers usually reply within 21 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mrvautin/ha-workouts#11 ·