Implement BiRefNet and HAT Sharper models with background removal capabilities

- Added validation documentation for AI model tiers.
- Introduced `background.py` for background removal logic, including inference functions for alpha and foreground extraction.
- Created `onnx_birefnet.py` to handle BiRefNet model sessions and alpha inference.
- Developed tests for background models, ensuring proper dispatch and session reuse.
- Added tests for BiRefNet ONNX model to validate alpha output and error handling for invalid values.
- Implemented model export scripts for BiRefNet and HAT Sharper, ensuring proper weight compression and licensing.
- Created `deform_sampling.py` for deformable convolution operations used in BiRefNet.
- Added utility functions for compressing ONNX weights without altering graph arithmetic.
- Introduced a reference plane node for depth field adjustments in geometry processing.
This commit is contained in:
2026-09-10 20:50:44 +08:00
parent 8ae3c1d5b7
commit e8129fe495
70 changed files with 1890 additions and 1208 deletions

View File

@@ -5,7 +5,7 @@ description = "Fast image-guided structure building tools for Blender"
readme = "README.md"
requires-python = ">=3.11,<3.12"
license = "GPL-3.0-or-later"
dependencies = ["blendjob==0.1.16", "numpy>=1.26,<2.0", "scipy==1.15.3"]
dependencies = ["blendjob==0.1.17", "numpy>=1.26,<2.0", "scipy==1.15.3"]
[dependency-groups]
dev = [
@@ -38,6 +38,9 @@ build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["tools"]
[tool.uv.sources]
blendjob = { path = "src/anyimage/wheels/blendjob-0.1.17-py3-none-any.whl" }
[tool.pytest.ini_options]
# Keep native asserts: bpy 4.5 can crash at shutdown after assertion rewriting.
addopts = "--assert=plain"