Add ONNX model inference implementations for MoGe-2, BEN2, and DA3

- Introduced `onnx_moge2.py` for MoGe-2 ONNX inference with NumPy post-processing.
- Added `onnx_ben2.py` for BEN2 ONNX inference with Pillow and NumPy preprocessing.
- Created `onnx_da3.py` for Depth Anything 3 inference with ONNX Runtime and NumPy.
- Implemented shared ONNX Runtime session helpers in `onnx_runtime.py`.
- Developed unit tests for server functionalities in `test_server.py`, including model caching and job management.
- Enhanced job server to handle frame extraction without requiring models.
This commit is contained in:
2026-08-17 10:37:55 +08:00
parent b3a07cde32
commit c5b77c5c85
58 changed files with 5840 additions and 9931 deletions

View File

@@ -1,8 +1,7 @@
from pathlib import Path
import bpy
from .client import device_enum_items
from .job_runtime import DEFAULT_STORAGE_ROOT, runtime
from .properties import device_enum_items
class SnapFormPreferences(bpy.types.AddonPreferences):
@@ -15,7 +14,7 @@ class SnapFormPreferences(bpy.types.AddonPreferences):
"all Blender versions can use the same directory"
),
subtype="DIR_PATH",
default=str(Path.home() / ".snapform"),
default=str(DEFAULT_STORAGE_ROOT),
)
device: bpy.props.EnumProperty(
name="Device",
@@ -28,19 +27,16 @@ class SnapFormPreferences(bpy.types.AddonPreferences):
)
def draw(self, _context):
from .operators import active_job
from .client import venv_directory, env_installed
layout = self.layout
layout.prop(self, "storage_root")
layout.prop(self, "device")
layout.separator()
layout.label(text=f"Environment: {venv_directory()}")
if env_installed():
layout.label(text=f"Environment: {runtime.environment_directory()}")
if runtime.environment_ready():
layout.label(text="Environment is installed", icon="CHECKMARK")
else:
install_row = layout.row()
install_row.enabled = active_job() is None
install_row.enabled = runtime.active_job is None
install_row.operator(
"snapform.install_environment",
text="Install Environment",
@@ -48,8 +44,7 @@ class SnapFormPreferences(bpy.types.AddonPreferences):
)
layout.separator()
operator = layout.operator(
"snapform.control_service",
text="Open Service Log",
"snapform.open_server_log",
text="Open Server Log",
icon="TEXT",
)
operator.action = "LOG"