recipe(BiRefNet_lite-ONNX): image segmentation recipes#1199
Closed
fuliucansheng wants to merge 1 commit into
Closed
recipe(BiRefNet_lite-ONNX): image segmentation recipes#1199fuliucansheng wants to merge 1 commit into
fuliucansheng wants to merge 1 commit into
Conversation
fuliucansheng
force-pushed
the
fuliucansheng/add-onnx-community-birefnet-lite-onnx-recipe
branch
2 times, most recently
from
July 24, 2026 04:03
e40f64a to
a1b91e8
Compare
fuliucansheng
force-pushed
the
fuliucansheng/add-onnx-community-birefnet-lite-onnx-recipe
branch
from
July 24, 2026 04:16
a1b91e8 to
8154cd8
Compare
Contributor
Author
|
Closing per request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds CPU recipe coverage for
onnx-community/BiRefNet_lite-ONNXas a direct Hub ONNX image-segmentation/background-removal model. This is an L0 recipe-only contribution: no WinML exporter code is changed, and the checked-in recipes document verified CPU fp32/fp16 direct-ONNX builds for the publishedonnx/model.onnxandonnx/model_fp16.onnxartifacts.The highest completed goal is L0 PASS. CPU perf was attempted but did not complete within the host time budget for either precision, and task eval is blocked on dataset/mask provenance rather than reported as a fabricated metric.
Model metadata
What the model does:
onnx-community/BiRefNet_lite-ONNXproduces a single-channel foreground/background mask from an RGB image. The checkpoint is published as a direct ONNX artifact for background removal, mask generation, and image segmentation.Primary user stories:
Supported tasks:
image-segmentationonnx/model.onnxandonnx/model_fp16.onnxModel architecture:
Source/confidence: graph I/O, task, dtype, and preprocessor contract are verified from the pinned direct ONNX artifacts and repository metadata. The high-level architecture tree is inferred from the published
model_type: swin, base-model tag, and ONNX node scopes; no source-code architecture change is made in this PR.Validation and support evidence
Baseline
Baseline was refreshed on current
origin/mainate405dc6638dff6cac96b1539ee0cea678cc6d183withwinml, version 0.2.0. The PR branch merge-base is the same commit.winml inspect -m onnx-community/BiRefNet_lite-ONNX --format jsonresolves the repository root asmodel_type: swin, taskfeature-extraction, loaderAutoModel, exporterSwinOnnxConfig, and inputpixel_values [1,3,224,224]. That is not the published BiRefNet segmentation ONNX graph shipped by this PR.uv run winml build -m onnx-community/BiRefNet_lite-ONNX ...attempts HuggingFace export and fails because the repo has no PyTorch/safetensors/TF/Flax weights.swinhas vendor ONNX tasksfeature-extraction,image-classification, andmasked-im; WinML adds no override tasks.onnx/model.onnxhas 16400 nodes, opset 17, inputinput_image [1,3,1024,1024]FLOAT, outputoutput_image [1,1,1024,1024]FLOAT, and 437 FLOAT initializers.onnx/model_fp16.onnxhas 16446 nodes with the same I/O and 437 FLOAT16 initializers.winml config -m .../onnx/model.onnxand.../model_fp16.onnxemitexport: null,optim: {},quant: null,compile: null; they do not inferloader.task.skip_optimizeit produces a mixed/fp32-sized optimized artifact: 4654 nodes with 450 FLOAT, 256 INT64, and only 40 FLOAT16 initializers plus a 243 MB external-data file.winml eval --schema --task image-segmentationis available, but no authoritative dataset revision, split, binary mask semantics, and label mapping were established for this background-removal artifact.Goal
Effort: L0. Goal ceiling: L1 attempted on CPU. Outcome: L0 recipe-only.
Success means the checked-in CPU fp32/fp16 recipes build structurally valid direct ONNX artifacts with the expected image-segmentation I/O. L1 CPU perf was attempted and recorded as timeout on this host; L2 numeric comparison is not claimed because this PR consumes published ONNX artifacts directly rather than exporting a matched PyTorch checkpoint; L3 is blocked by dataset and semantic provenance.
Outcome
Highest verified goal: L0 PASS on CPU for both fp32 and fp16. Coverage is full for the targeted direct-ONNX build tuples (
cpu/cpu/fp32,cpu/cpu/fp16); no accelerator tuples are claimed.Shipped recipes:
examples/recipes/onnx-community_BiRefNet_lite-ONNX/cpu/cpu/image-segmentation_fp32_config.jsonexamples/recipes/onnx-community_BiRefNet_lite-ONNX/cpu/cpu/image-segmentation_fp16_config.jsonNo methodology friction observed. The fp16
skip_optimize: truefield is a model-specific direct-ONNX recipe delta, not a skill or CLI methodology change. No source, skill, orexamples/recipes/README.mdfiles are included in this model PR.Per-EP/device/precision results
onnx/model.onnx; optimized final graph has inputinput_image [1,3,1024,1024]FLOAT, outputoutput_image [1,1,1024,1024]FLOAT, 4099 nodes, FLOAT/INT64 initializers, and colocated external data.onnx/model_fp16.onnxwith--precision fp16andskip_optimize: true; final graph keeps 16446 nodes and 437 FLOAT16 initializers, with the same FLOAT input/output mask contract.winml perfwith 3 iterations and 1 warmup did not complete within about 904s on this host; no latency/throughput/memory JSON was produced.winml perfwith 1 iteration and 0 warmup did not complete within about 304s on this host; no latency/throughput/memory JSON was produced.image-segmentation, but no authoritative dataset/revision/split and foreground-mask semantic mapping were established for this checkpoint.Available runtime providers on this host:
['AzureExecutionProvider', 'CPUExecutionProvider'].Delta
The fp32 recipe adds the missing loader task to the direct-ONNX CPU auto-config shape. The fp16 recipe also preserves the published fp16 ONNX graph by disabling the optimization path that otherwise expands the artifact back toward fp32.
/loader/taskimage-segmentation/loader/taskimage-segmentation/skip_optimizetrueonnx/model_fp16.onnxgraph and its 437 FLOAT16 initializers. Recipe-free direct build re-optimizes into a mixed/fp32-sized artifact.No source code or tests are changed, and
examples/recipes/README.mdis untouched.Reducibility: recipe-only is appropriate because the deltas are direct-artifact task intent and checkpoint-specific fp16 preservation. A class-wide Swin exporter or task-resolution change would not correctly describe the repository-root
swinfeature-extraction config versus the shipped segmentation ONNX graph.Analyze summary
Static rule analysis produced parseable JSON but exited nonzero because rule derivation lacks required shape information for some
GatherND/Convchecks and reportsSumunsupported during QNN/OpenVINO rule evaluation. This is compatibility analysis, not runtime execution.Component-level summary
GatherND,Sum,Conv, and related decoder ops. VitisAI has no useful op-level support rules for this graph on this host.Op-level summary
Reproduce commands