Add new functionality for image rectification and depth metadata handling

- Implemented a preview tool for rectifying images with interactive aspect controls in `preview.py`.
- Added tests for depth metadata loading to ensure consistent schema usage in `test_depth_metadata.py`.
- Developed comprehensive tests for cutout calibration processes in `test_cutout_calibration.py`, including stability checks and depth calibration.
- Created tests for frame compositing operations in `test_frame_compositing.py`, ensuring correct handling of depth and transparency.
- Introduced material slot inheritance functionality in `material_slots.py` to manage geometry material assignments.
- Built shared shader nodes for material processing in `shader.py`, including roughness and bump mapping setups.
This commit is contained in:
2026-09-12 19:20:06 +08:00
parent e8268504c2
commit 938d95db0f
175 changed files with 3812 additions and 6864 deletions

View File

@@ -7,6 +7,7 @@ from tests.anyimage.server.runtime_support import ServerTestCase
class JobServerTest(ServerTestCase):
def test_dedicated_server_runs_only_one_job_at_a_time(self):
server = self.JobServer("Test", storage_root=self.storage_root)
self.addCleanup(server.close)
first_started = threading.Event()
release_first = threading.Event()
order = []
@@ -26,16 +27,15 @@ class JobServerTest(ServerTestCase):
self.assertIsNotNone(second)
self.assertTrue(server.snapshot("instance")["busy"])
self.assertEqual(server.snapshot("instance")["queued_jobs"], 1)
self.assertNotIn("clients", server.snapshot("instance"))
release_first.set()
self.wait_for_job(first)
self.wait_for_job(second)
self.assertEqual(order, ["first", "second"])
server.close()
def test_queued_job_can_be_cancelled_before_it_runs(self):
server = self.JobServer("Test", storage_root=self.storage_root)
self.addCleanup(server.close)
first_started = threading.Event()
release_first = threading.Event()
executed = []
@@ -58,7 +58,6 @@ class JobServerTest(ServerTestCase):
self.assertEqual(second_status["state"], "cancelled")
self.assertEqual(executed, ["first"])
server.close()
def test_cancelling_job_keeps_server_and_model_cache_alive(self):
@@ -94,6 +93,7 @@ class JobServerTest(ServerTestCase):
def test_job_progress_is_kept_in_server_memory(self):
server = self.JobServer("Test", storage_root=self.storage_root)
self.addCleanup(server.close)
@server.job("example")
def example(context, _parameters):
@@ -111,6 +111,7 @@ class JobServerTest(ServerTestCase):
def test_runtime_storage_root_owns_the_jobs_directory(self):
storage_root = self.storage_root
server = self.JobServer("Test")
self.addCleanup(server.close)
server.bind(storage_root)
@server.job("example")
@@ -133,6 +134,7 @@ class JobServerTest(ServerTestCase):
close=lambda: events.append("close"),
)
server = self.JobServer("Test", storage_root=self.storage_root)
self.addCleanup(server.close)
server.add_resource("model_manager", resource)
@server.job("example")