From 470abe80975fd2a7ef87bbfe4e9e0593b0195853 Mon Sep 17 00:00:00 2001 From: Caenorst Date: Thu, 27 Feb 2025 22:16:47 -0500 Subject: [PATCH] Avoid warp init at import. Also add SATR in Readme (#862) * fix torch version in installation doc Signed-off-by: Clement Fuji Tsang * initialize warp later fix issue introduced in last PR add SATR in users list in README Signed-off-by: Clement Fuji Tsang --------- Signed-off-by: Clement Fuji Tsang Signed-off-by: Ligo <1569731302@qq.com> --- README.md | 2 ++ kaolin/physics/simplicits/losses_warp.py | 4 ---- kaolin/render/camera/intrinsics_ortho.py | 8 ++------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1d3f6d5bc..c6473ebd6 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ Please review our [contribution guidelines](CONTRIBUTING.md). * [Flexible Isosurface Extraction for Gradient-Based Mesh Optimization (FlexiCubes) ](https://github.com/nv-tlabs/FlexiCubes): * Use [Flexicube class](https://kaolin.readthedocs.io/en/latest/modules/kaolin.non_commercial.html#kaolin.non_commercial.FlexiCubes), [obj loader](https://kaolin.readthedocs.io/en/latest/modules/kaolin.io.obj.html), [turntable visualizer](https://kaolin.readthedocs.io/en/latest/modules/kaolin.visualize.html#kaolin.visualize.IpyTurntableVisualizer) +* [SATR](https://github.com/Samir55/SATR): + * Use [Kaolin's rendering functions](https://kaolin.readthedocs.io/en/latest/modules/kaolin.render.mesh.html#), [lighting functions](https://kaolin.readthedocs.io/en/latest/modules/kaolin.render.lighting.html), [camera functions](https://kaolin.readthedocs.io/en/latest/modules/kaolin.render.camera.html), and [obj](https://kaolin.readthedocs.io/en/latest/modules/kaolin.io.obj.html#kaolin.io.obj.import_mesh)/[off](https://kaolin.readthedocs.io/en/latest/modules/kaolin.io.off.html#kaolin.io.off.import_mesh) importers. ## Licenses diff --git a/kaolin/physics/simplicits/losses_warp.py b/kaolin/physics/simplicits/losses_warp.py index c3000421d..d6f81bcce 100644 --- a/kaolin/physics/simplicits/losses_warp.py +++ b/kaolin/physics/simplicits/losses_warp.py @@ -23,10 +23,6 @@ import kaolin.physics.materials.neohookean_elastic_material as neohookean_elastic_material from kaolin.physics.simplicits.losses import loss_ortho - -wp.init() -wp.config.quiet = False - # Type defs mat34f = wp.types.matrix(shape=(3, 4), dtype=wp.float32) mat34 = mat34f diff --git a/kaolin/render/camera/intrinsics_ortho.py b/kaolin/render/camera/intrinsics_ortho.py index 43b058451..5221a3042 100644 --- a/kaolin/render/camera/intrinsics_ortho.py +++ b/kaolin/render/camera/intrinsics_ortho.py @@ -165,13 +165,9 @@ def projection_matrix(self) -> torch.Tensor: # kaolin follows OpenGL conventions of NDC in [-1, 1], where the center of the canvas is denoted as (0, 0) # The following lines ensure the projection matrix is compatible with OpenGL. # Practitioners using a different graphics api may modify this matrix. - # top = self.height / 2 - # bottom = -top - # right = self.width / 2 - # left = -right - top = 1.0 + top = self.height / 2 bottom = -top - right = 1.0 * self.width / self.height + right = self.width / 2 left = -right ortho = self.orthographic_matrix(left, right, bottom, top, self.near, self.far) return ortho