Bi ref net

From VectorSpaceLab/AREX-Skill · View interactive version

Bi ref net is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Route BiRefNet image segmentation, matting, inference, configuration, training, evaluation, and model-export workflows.

How to use this skill

Skill file

BiRefNet Repo Skill

Use this skill when a task involves BiRefNet / BiRefNet-style high-resolution binary image segmentation, background removal, dichotomous image segmentation, camouflaged object detection, salient object detection, or trimap-free matting.

BiRefNet is a source-code-first PyTorch repository plus Hugging Face model-family workflow. Prefer self-contained instructions and bundled helpers here instead of reopening the original repository notebooks or shell scripts.

First checks

  1. Read references/repo-provenance.md when checking whether this skill matches a checkout or before refreshing it.
  2. Read references/environment-and-install.md before installing dependencies, choosing CPU/CUDA, or using the Hugging Face one-line model path.
  3. Run scripts/check_birefnet_environment.py when you need a safe dependency/import/backend probe.
  4. Use references/troubleshooting.md for cross-cutting install, import, backend, data, and model-asset failures.

Minimal source-code inspection check for a checkout:

python scripts/check_birefnet_environment.py --repo-root /path/to/BiRefNet --check-source

Minimal dependency-only check:

python scripts/check_birefnet_environment.py

Route map

Common task routing

| User asks for... | Go to |

|---|---|

| "How do I format custom data for BiRefNet?" | configuration-and-data |

| "Which config fields change task, backbone, size, or losses?" | configuration-and-data plus model-architecture |

| "Load a BiRefNet checkpoint or fix state-dict key mismatches" | model-architecture |

| "Run background removal on images or save masks/foregrounds" | inference-and-postprocessing |

| "Process videos with BiRefNet" | inference-and-postprocessing |

| "Fine-tune from existing weights" | training-and-evaluation plus configuration-and-data |

| "Evaluate predictions or choose the best epoch" | training-and-evaluation |

| "Convert to ONNX or plan deployment" | model-architecture with inference constraints from inference-and-postprocessing |

Verification-friendly helpers

Use these bundled scripts before recommending expensive work:

When not to use this skill

Do not use this skill as the primary guide for SAM, YOLO, Detectron2, MMSegmentation, or another segmentation package unless the user is specifically comparing those tools to BiRefNet. Do not use it for generic PyTorch training advice that does not involve BiRefNet config, checkpoints, data layout, or metrics. Use a deployment-specific skill when the user asks primarily about TensorRT, GGUF, web APIs, or a third-party serving platform rather than BiRefNet itself.

Dependency and backend stance

Self-containment rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.