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:
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
|
||||
from .models import MODELS
|
||||
from .models import BEN2_MODEL, MODELS
|
||||
from .operators import active_job
|
||||
from .runtime import model_ready, runtime_ready
|
||||
|
||||
@@ -29,6 +29,7 @@ class RuntimeModelsPanel(bpy.types.Panel):
|
||||
|
||||
for model in MODELS.values():
|
||||
self._draw_model(layout, model, running)
|
||||
self._draw_model(layout, BEN2_MODEL, running)
|
||||
|
||||
def _draw_model(self, layout, model, running):
|
||||
row = layout.row(align=True)
|
||||
@@ -106,3 +107,15 @@ class DebugPanel(bpy.types.Panel):
|
||||
icon="EXPORT",
|
||||
)
|
||||
operator.job_type = "RECONSTRUCT"
|
||||
|
||||
background_box = layout.box()
|
||||
background_box.label(text="BEN2 Background Removal")
|
||||
background_box.prop(settings, "background_input_path")
|
||||
background_row = background_box.row()
|
||||
background_row.enabled = active_job() is None
|
||||
operator = background_row.operator(
|
||||
"snapform.run_job",
|
||||
text="Remove Background",
|
||||
icon="IMAGE_ALPHA",
|
||||
)
|
||||
operator.job_type = "REMOVE_BACKGROUND"
|
||||
|
||||
Reference in New Issue
Block a user