diff --git a/pytorch3d/common/__init__.py b/pytorch3d/common/__init__.py index f34c1017..32b79ce3 100644 --- a/pytorch3d/common/__init__.py +++ b/pytorch3d/common/__init__.py @@ -4,6 +4,7 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -from .types import Device, make_device, get_device +from .types import Device, get_device, make_device + __all__ = [k for k in globals().keys() if not k.startswith("_")] diff --git a/pytorch3d/io/obj_io.py b/pytorch3d/io/obj_io.py index 16cb9eb1..eaa7563b 100644 --- a/pytorch3d/io/obj_io.py +++ b/pytorch3d/io/obj_io.py @@ -10,7 +10,7 @@ import os import warnings from collections import namedtuple from pathlib import Path -from typing import List, Optional, Union +from typing import List, Optional import numpy as np import torch @@ -18,12 +18,7 @@ from iopath.common.file_io import PathManager from PIL import Image from pytorch3d.common.types import Device from pytorch3d.io.mtl_io import load_mtl, make_mesh_texture_atlas -from pytorch3d.io.utils import ( - PathOrStr, - _check_faces_indices, - _make_tensor, - _open_file, -) +from pytorch3d.io.utils import PathOrStr, _check_faces_indices, _make_tensor, _open_file from pytorch3d.renderer import TexturesAtlas, TexturesUV from pytorch3d.structures import Meshes, join_meshes_as_batch diff --git a/pytorch3d/io/pluggable_formats.py b/pytorch3d/io/pluggable_formats.py index 0c52f853..acd0a025 100644 --- a/pytorch3d/io/pluggable_formats.py +++ b/pytorch3d/io/pluggable_formats.py @@ -6,7 +6,7 @@ import pathlib -from typing import Optional, Tuple, Union +from typing import Optional, Tuple from iopath.common.file_io import PathManager from pytorch3d.common.types import Device diff --git a/pytorch3d/io/ply_io.py b/pytorch3d/io/ply_io.py index 802d4636..fc8386f8 100644 --- a/pytorch3d/io/ply_io.py +++ b/pytorch3d/io/ply_io.py @@ -15,17 +15,12 @@ import sys import warnings from collections import namedtuple from io import BytesIO, TextIOBase -from typing import List, Optional, Tuple, Union, cast +from typing import List, Optional, Tuple, cast import numpy as np import torch from iopath.common.file_io import PathManager -from pytorch3d.io.utils import ( - PathOrStr, - _check_faces_indices, - _make_tensor, - _open_file, -) +from pytorch3d.io.utils import PathOrStr, _check_faces_indices, _make_tensor, _open_file from pytorch3d.renderer import TexturesVertex from pytorch3d.structures import Meshes, Pointclouds diff --git a/pytorch3d/ops/__init__.py b/pytorch3d/ops/__init__.py index 80aa09a7..22ab32c8 100644 --- a/pytorch3d/ops/__init__.py +++ b/pytorch3d/ops/__init__.py @@ -9,7 +9,7 @@ from .cubify import cubify from .graph_conv import GraphConv from .interp_face_attrs import interpolate_face_attributes from .knn import knn_gather, knn_points -from .laplacian_matrices import laplacian, cot_laplacian, norm_laplacian +from .laplacian_matrices import cot_laplacian, laplacian, norm_laplacian from .mesh_face_areas_normals import mesh_face_areas_normals from .mesh_filtering import taubin_smoothing from .packed_to_padded import packed_to_padded, padded_to_packed diff --git a/pytorch3d/ops/laplacian_matrices.py b/pytorch3d/ops/laplacian_matrices.py index fb898dec..b18e6ca8 100644 --- a/pytorch3d/ops/laplacian_matrices.py +++ b/pytorch3d/ops/laplacian_matrices.py @@ -8,6 +8,7 @@ from typing import Tuple import torch + # ------------------------ Laplacian Matrices ------------------------ # # This file contains implementations of differentiable laplacian matrices. # These include diff --git a/tests/test_camera_conversions.py b/tests/test_camera_conversions.py index afc3f04e..0f1c7acc 100644 --- a/tests/test_camera_conversions.py +++ b/tests/test_camera_conversions.py @@ -18,6 +18,7 @@ from pytorch3d.utils import ( opencv_from_cameras_projection, ) + DATA_DIR = get_tests_dir() / "data" diff --git a/tests/test_laplacian_matrices.py b/tests/test_laplacian_matrices.py index 33927d28..f72e1890 100644 --- a/tests/test_laplacian_matrices.py +++ b/tests/test_laplacian_matrices.py @@ -8,7 +8,7 @@ import unittest import torch from common_testing import TestCaseMixin, get_random_cuda_device -from pytorch3d.ops import laplacian, norm_laplacian, cot_laplacian +from pytorch3d.ops import cot_laplacian, laplacian, norm_laplacian from pytorch3d.structures.meshes import Meshes @@ -54,7 +54,7 @@ class TestLaplacianMatrices(TestCaseMixin, unittest.TestCase): mesh = self.init_mesh() verts = mesh.verts_packed() faces = mesh.faces_packed() - V, F = verts.shape[0], faces.shape[0] + V = verts.shape[0] eps = 1e-12