Add new tests and functionality for image processing and geometry handling

- Introduced color_image.py for preparing standalone color images for tests.
- Added hdr_image.py to create HDR textures for testing.
- Implemented test_image_depth_panorama.py to evaluate panorama topology, UVs, and depth discontinuities.
- Created test_shadeless.py to validate the opacity and HDR color endpoints of the Shadeless group.
- Developed moge3_export.py for exporting dynamic MoGe-3 backbone and ONNX graphs.
- Added material.py to inherit material slots onto generated geometry.
- Built image_depth_panorama.py to construct a quad panorama with depth separation and sampling.
This commit is contained in:
2026-09-10 14:42:17 +08:00
parent 27ca25224a
commit 489003c2cc
136 changed files with 5758 additions and 1083 deletions

View File

@@ -51,10 +51,13 @@ def remove_background(image):
"""Use the project's existing BEN2 implementation for the trial input."""
root = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(root / "src/anyimage/server/models"))
from onnx_ben2 import create_session, infer
from onnx_ben2 import create_session, infer_alpha
session = create_session(root / "models/BEN2-ONNX", "cpu")
return infer(session, image, release_memory=True)
alpha = infer_alpha(session, image, release_memory=True)
foreground = image.convert("RGBA")
foreground.putalpha(Image.fromarray((alpha * 255).astype(np.uint8)))
return foreground
def main():