feat: Add BEN2 background removal functionality and integrate into SnapForm

- Introduced BEN2 model for background removal in the panel and properties.
- Updated runtime to handle background removal commands and model downloads.
- Implemented background removal logic in worker, including image processing and saving results.
- Enhanced tests to cover new background removal features and ensure proper integration.
- Updated version to 0.9.28 to reflect new features and improvements.
This commit is contained in:
2026-08-03 20:18:00 +08:00
parent 69eaefa016
commit d694980da7
19 changed files with 1523 additions and 84 deletions

View File

@@ -31,6 +31,7 @@ class BootstrapRuntimeTest(unittest.TestCase):
runtime_dir=str(runtime_dir),
backend="cu128",
da3_commit="test-commit",
ben2_commit="test-ben2-commit",
status=str(root / "status.json"),
)
with patch.object(bootstrap, "run") as mocked_run:
@@ -58,6 +59,22 @@ class BootstrapRuntimeTest(unittest.TestCase):
)
self.assertEqual(gsplat_call.args[1], {"BUILD_NO_CUDA": "1"})
ben2_command = next(
command
for command in commands
if any("ben2 @" in str(value) for value in command)
)
self.assertTrue(
any("test-ben2-commit" in str(value) for value in ben2_command)
)
check_command = commands[-1]
self.assertTrue(
any(
"from ben2 import BEN_Base" in str(value)
for value in check_command
)
)
if __name__ == "__main__":
unittest.main()