feat: Add new Geometry Nodes groups for image relief and shadeless shader
- Implemented the "O Image Relief Plane" Geometry Nodes group to create a fixed-base image relief using depth images and various parameters. - Created the "O Shadeless" shader node group to display color without scene lighting while preserving shadows and reflections. - Introduced a preview feature for node groups, allowing for interactive visualization of node arrangements in an HTML format. - Added a template HTML file for rendering node previews with customizable views and controls.
This commit is contained in:
@@ -184,11 +184,26 @@ class Moge2OnnxTest(unittest.TestCase):
|
||||
"metric_scale": np.array((metric_scale,), dtype=np.float32),
|
||||
}
|
||||
|
||||
raw["mask"][0, 0, :4] = [0.0, 0.2, 0.7, 1.0]
|
||||
result = self.moge.postprocess(raw)
|
||||
|
||||
np.testing.assert_allclose(result["depth"], depth * metric_scale, rtol=1e-3)
|
||||
np.testing.assert_allclose(result["points"][..., 2], result["depth"], rtol=1e-5)
|
||||
self.assertTrue(result["mask"].all())
|
||||
np.testing.assert_array_equal(result["mask"], raw["mask"][0])
|
||||
|
||||
def test_postprocess_preserves_mask_for_nonpositive_depth(self):
|
||||
mask = np.array([[[0.2, 0.7], [0.0, 1.0]]], dtype=np.float32)
|
||||
raw = {
|
||||
"points": np.zeros((1, 2, 2, 3), dtype=np.float32),
|
||||
"normal": np.zeros((1, 2, 2, 3), dtype=np.float32),
|
||||
"mask": mask,
|
||||
"metric_scale": np.ones(1, dtype=np.float32),
|
||||
}
|
||||
with patch.object(self.moge, "recover_focal_shift", return_value=(1.0, -1.0)) as recover:
|
||||
result = self.moge.postprocess(raw)
|
||||
np.testing.assert_array_equal(recover.call_args.args[1], mask[0] > 0.5)
|
||||
np.testing.assert_array_equal(result["mask"], mask[0])
|
||||
self.assertTrue((result["depth"] < 0).all())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user