diff --git a/deodr/differentiable_renderer.py b/deodr/differentiable_renderer.py index e70409e..0022cca 100644 --- a/deodr/differentiable_renderer.py +++ b/deodr/differentiable_renderer.py @@ -293,7 +293,7 @@ def world_to_camera(self, points_3d: np.ndarray) -> np.ndarray: return points_3d.dot(self.extrinsic[:3, :3].T) + self.extrinsic[:3, 3] def camera_to_world_mtx_4x4(self) -> np.ndarray: - return np.row_stack( + return np.vstack( ( np.column_stack((self.extrinsic[:, :3].T, self.get_center())), np.array((0, 0, 0, 1)), diff --git a/deodr/examples/rgb_image_hand_fitting.py b/deodr/examples/rgb_image_hand_fitting.py index 63fa49c..bab4c4f 100644 --- a/deodr/examples/rgb_image_hand_fitting.py +++ b/deodr/examples/rgb_image_hand_fitting.py @@ -71,7 +71,7 @@ def run( hand_fitter.reset() background_color = np.median( - np.row_stack( + np.vstack( ( hand_image[:10, :10, :].reshape(-1, 3), hand_image[-10:, :10, :].reshape(-1, 3), diff --git a/deodr/examples/rgb_multiview_hand.py b/deodr/examples/rgb_multiview_hand.py index 7ab1b2e..c6dc8d2 100644 --- a/deodr/examples/rgb_multiview_hand.py +++ b/deodr/examples/rgb_multiview_hand.py @@ -41,7 +41,7 @@ def run( default_light_ambient = 0.6 # default_light = {'directional':np.array([0.0,0.0,0.0]),'ambient':np.array([0.6])} - euler_init = np.row_stack([np.array([0, yrot, 0]) for yrot in np.linspace(-0.5, 0.5, 3)]) + euler_init = np.vstack([np.array([0, yrot, 0]) for yrot in np.linspace(-0.5, 0.5, 3)]) vertices = vertices - np.mean(vertices, axis=0) t_init = np.array([0, -0.2, 0.2]) @@ -69,7 +69,7 @@ def run( hand_image = hand_images[0] background_color = np.median( - np.row_stack( + np.vstack( ( hand_image[:10, :10, :].reshape(-1, 3), hand_image[-10:, :10, :].reshape(-1, 3), @@ -97,7 +97,7 @@ def run( if display or save_images: combined_image = np.column_stack( ( - np.row_stack(hand_images), + np.vstack(hand_images), image, np.tile(np.minimum(diff_image, 1)[:, :, None], (1, 1, 3)), ) diff --git a/deodr/obj.py b/deodr/obj.py index 06020b4..0651322 100644 --- a/deodr/obj.py +++ b/deodr/obj.py @@ -45,8 +45,8 @@ def read_obj(filename: str) -> Tuple[np.ndarray, np.ndarray]: cleaned_fields.append(v) faces.append(np.array(cleaned_fields)) - faces_np = np.row_stack(faces) - vertices_np = np.row_stack(vertices) + faces_np = np.vstack(faces) + vertices_np = np.vstack(vertices) return faces_np, vertices_np diff --git a/deodr/opengl/moderngl.py b/deodr/opengl/moderngl.py index 965cf69..e68fa0c 100644 --- a/deodr/opengl/moderngl.py +++ b/deodr/opengl/moderngl.py @@ -128,7 +128,7 @@ def set_texture(self, texture: np.ndarray) -> None: # texture.build_mipmaps() def set_camera(self, camera: Camera) -> None: - extrinsic = np.row_stack((camera.extrinsic, [0, 0, 0, 1])) + extrinsic = np.vstack((camera.extrinsic, [0, 0, 0, 1])) intrinsic = Matrix44( np.diag([1, -1, -1, 1]).dot( diff --git a/deodr/tensorflow/tools.py b/deodr/tensorflow/tools.py index d7ec148..32e09af 100644 --- a/deodr/tensorflow/tools.py +++ b/deodr/tensorflow/tools.py @@ -7,5 +7,5 @@ def scipy_sparse_matrix_to_tensorflow(x: scipy.sparse.spmatrix) -> tf.SparseTensor: coo = x.tocoo() - indices = np.mat([coo.row, coo.col]).transpose() + indices = np.array([coo.row, coo.col]).transpose() return tf.SparseTensor(indices, coo.data, coo.shape) diff --git a/deodr/triangulated_mesh.py b/deodr/triangulated_mesh.py index 574cb31..25806e8 100644 --- a/deodr/triangulated_mesh.py +++ b/deodr/triangulated_mesh.py @@ -546,7 +546,7 @@ def loop_subdivision(mesh: ColoredTriMesh, n_iter: int = 1) -> ColoredTriMesh: mesh.adjacencies.faces_edges[:, 2] + mesh.nb_vertices, ) ) - new_faces = np.row_stack((faces1, faces2, faces3, faces4)) + new_faces = np.vstack((faces1, faces2, faces3, faces4)) if mesh.uv is not None: raise BaseException("Textured mesh not supported yet in subdivision.") if mesh.vertices_colors is not None: