"vscode:/vscode.git/clone" did not exist on "c53deb26ab9d91ff2bb6dc3539fee20d091727a0"
Commit 34f648ed authored by Jeremy Reizenstein's avatar Jeremy Reizenstein Committed by Facebook GitHub Bot
Browse files

move targets

Summary: Move testing targets from pytorch3d/tests/TARGETS to pytorch3d/TARGETS.

Reviewed By: shapovalov

Differential Revision: D36186940

fbshipit-source-id: a4c52c4d99351f885e2b0bf870532d530324039b
parent f625fe1f
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
import unittest import unittest
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer.materials import Materials from pytorch3d.renderer.materials import Materials
from .common_testing import TestCaseMixin
class TestMaterials(TestCaseMixin, unittest.TestCase): class TestMaterials(TestCaseMixin, unittest.TestCase):
def test_init(self): def test_init(self):
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
import unittest import unittest
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.loss import mesh_edge_loss from pytorch3d.loss import mesh_edge_loss
from pytorch3d.structures import Meshes from pytorch3d.structures import Meshes
from test_sample_points_from_meshes import init_meshes
from .common_testing import TestCaseMixin
from .test_sample_points_from_meshes import init_meshes
class TestMeshEdgeLoss(TestCaseMixin, unittest.TestCase): class TestMeshEdgeLoss(TestCaseMixin, unittest.TestCase):
......
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
import unittest import unittest
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.ops import taubin_smoothing from pytorch3d.ops import taubin_smoothing
from pytorch3d.structures import Meshes from pytorch3d.structures import Meshes
from pytorch3d.utils import ico_sphere from pytorch3d.utils import ico_sphere
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestTaubinSmoothing(TestCaseMixin, unittest.TestCase): class TestTaubinSmoothing(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -10,9 +10,10 @@ import unittest ...@@ -10,9 +10,10 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.structures.meshes import Meshes from pytorch3d.structures.meshes import Meshes
from .common_testing import TestCaseMixin
def init_mesh( def init_mesh(
num_meshes: int = 10, num_meshes: int = 10,
......
...@@ -8,9 +8,10 @@ import unittest ...@@ -8,9 +8,10 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.ops import utils as oputil from pytorch3d.ops import utils as oputil
from .common_testing import TestCaseMixin
class TestOpsUtils(TestCaseMixin, unittest.TestCase): class TestOpsUtils(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
import unittest import unittest
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.ops import packed_to_padded, padded_to_packed from pytorch3d.ops import packed_to_padded, padded_to_packed
from pytorch3d.structures.meshes import Meshes from pytorch3d.structures.meshes import Meshes
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestPackedToPadded(TestCaseMixin, unittest.TestCase): class TestPackedToPadded(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
import unittest import unittest
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.ops import perspective_n_points from pytorch3d.ops import perspective_n_points
from pytorch3d.transforms import rotation_conversions from pytorch3d.transforms import rotation_conversions
from .common_testing import TestCaseMixin
def reproj_error(x_world, y, R, T, weight=None): def reproj_error(x_world, y, R, T, weight=None):
# applies the affine transform, projects, and computes the reprojection error # applies the affine transform, projects, and computes the reprojection error
......
...@@ -8,11 +8,12 @@ import unittest ...@@ -8,11 +8,12 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d import _C from pytorch3d import _C
from pytorch3d.loss import point_mesh_edge_distance, point_mesh_face_distance from pytorch3d.loss import point_mesh_edge_distance, point_mesh_face_distance
from pytorch3d.structures import Meshes, packed_to_list, Pointclouds from pytorch3d.structures import Meshes, packed_to_list, Pointclouds
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestPointMeshDistance(TestCaseMixin, unittest.TestCase): class TestPointMeshDistance(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -10,10 +10,11 @@ import unittest ...@@ -10,10 +10,11 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.structures import utils as struct_utils from pytorch3d.structures import utils as struct_utils
from pytorch3d.structures.pointclouds import join_pointclouds_as_batch, Pointclouds from pytorch3d.structures.pointclouds import join_pointclouds_as_batch, Pointclouds
from .common_testing import TestCaseMixin
class TestPointclouds(TestCaseMixin, unittest.TestCase): class TestPointclouds(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -8,11 +8,12 @@ import unittest ...@@ -8,11 +8,12 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import get_tests_dir, TestCaseMixin
from pytorch3d.ops import points_alignment from pytorch3d.ops import points_alignment
from pytorch3d.structures.pointclouds import Pointclouds from pytorch3d.structures.pointclouds import Pointclouds
from pytorch3d.transforms import rotation_conversions from pytorch3d.transforms import rotation_conversions
from .common_testing import get_tests_dir, TestCaseMixin
def _apply_pcl_transformation(X, R, T, s=None): def _apply_pcl_transformation(X, R, T, s=None):
""" """
......
...@@ -8,13 +8,14 @@ import unittest ...@@ -8,13 +8,14 @@ import unittest
from typing import Tuple, Union from typing import Tuple, Union
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.ops import ( from pytorch3d.ops import (
estimate_pointcloud_local_coord_frames, estimate_pointcloud_local_coord_frames,
estimate_pointcloud_normals, estimate_pointcloud_normals,
) )
from pytorch3d.structures.pointclouds import Pointclouds from pytorch3d.structures.pointclouds import Pointclouds
from .common_testing import TestCaseMixin
DEBUG = False DEBUG = False
......
...@@ -11,7 +11,6 @@ from typing import Tuple ...@@ -11,7 +11,6 @@ from typing import Tuple
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.ops import ( from pytorch3d.ops import (
add_pointclouds_to_volumes, add_pointclouds_to_volumes,
add_points_features_to_volume_densities_features, add_points_features_to_volume_densities_features,
...@@ -23,6 +22,8 @@ from pytorch3d.structures.pointclouds import Pointclouds ...@@ -23,6 +22,8 @@ from pytorch3d.structures.pointclouds import Pointclouds
from pytorch3d.structures.volumes import Volumes from pytorch3d.structures.volumes import Volumes
from pytorch3d.transforms.so3 import so3_exp_map from pytorch3d.transforms.so3 import so3_exp_map
from .common_testing import TestCaseMixin
DEBUG = False DEBUG = False
if DEBUG: if DEBUG:
......
...@@ -13,7 +13,6 @@ import unittest ...@@ -13,7 +13,6 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import get_tests_dir, load_rgb_image, TestCaseMixin
from PIL import Image from PIL import Image
from pytorch3d.datasets import ( from pytorch3d.datasets import (
BlenderCamera, BlenderCamera,
...@@ -32,6 +31,8 @@ from pytorch3d.transforms import Transform3d ...@@ -32,6 +31,8 @@ from pytorch3d.transforms import Transform3d
from pytorch3d.transforms.so3 import so3_exp_map from pytorch3d.transforms.so3 import so3_exp_map
from torch.utils.data import DataLoader from torch.utils.data import DataLoader
from .common_testing import get_tests_dir, load_rgb_image, TestCaseMixin
# Set these paths in order to run the tests. # Set these paths in order to run the tests.
R2N2_PATH = None R2N2_PATH = None
......
...@@ -8,7 +8,6 @@ import functools ...@@ -8,7 +8,6 @@ import functools
import unittest import unittest
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d import _C from pytorch3d import _C
from pytorch3d.renderer import FoVPerspectiveCameras, look_at_view_transform from pytorch3d.renderer import FoVPerspectiveCameras, look_at_view_transform
from pytorch3d.renderer.mesh import MeshRasterizer, RasterizationSettings from pytorch3d.renderer.mesh import MeshRasterizer, RasterizationSettings
...@@ -23,6 +22,8 @@ from pytorch3d.renderer.mesh.utils import ( ...@@ -23,6 +22,8 @@ from pytorch3d.renderer.mesh.utils import (
from pytorch3d.structures import Meshes from pytorch3d.structures import Meshes
from pytorch3d.utils import ico_sphere from pytorch3d.utils import ico_sphere
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestRasterizeMeshes(TestCaseMixin, unittest.TestCase): class TestRasterizeMeshes(TestCaseMixin, unittest.TestCase):
def test_simple_python(self): def test_simple_python(self):
......
...@@ -9,7 +9,6 @@ import unittest ...@@ -9,7 +9,6 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d import _C from pytorch3d import _C
from pytorch3d.renderer.points.rasterize_points import ( from pytorch3d.renderer.points.rasterize_points import (
_format_radius, _format_radius,
...@@ -18,6 +17,8 @@ from pytorch3d.renderer.points.rasterize_points import ( ...@@ -18,6 +17,8 @@ from pytorch3d.renderer.points.rasterize_points import (
) )
from pytorch3d.structures.pointclouds import Pointclouds from pytorch3d.structures.pointclouds import Pointclouds
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestRasterizePoints(TestCaseMixin, unittest.TestCase): class TestRasterizePoints(TestCaseMixin, unittest.TestCase):
def test_python_simple_cpu(self): def test_python_simple_cpu(self):
......
...@@ -9,12 +9,6 @@ from itertools import product ...@@ -9,12 +9,6 @@ from itertools import product
import numpy as np import numpy as np
import torch import torch
from common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
from PIL import Image from PIL import Image
from pytorch3d.io import load_obj from pytorch3d.io import load_obj
from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_transform from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_transform
...@@ -48,6 +42,13 @@ from pytorch3d.structures import Meshes, Pointclouds ...@@ -48,6 +42,13 @@ from pytorch3d.structures import Meshes, Pointclouds
from pytorch3d.transforms.transform3d import Transform3d from pytorch3d.transforms.transform3d import Transform3d
from pytorch3d.utils import torus from pytorch3d.utils import torus
from .common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
DEBUG = False DEBUG = False
DATA_DIR = get_tests_dir() / "data" DATA_DIR = get_tests_dir() / "data"
......
...@@ -9,7 +9,6 @@ import unittest ...@@ -9,7 +9,6 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import get_tests_dir
from PIL import Image from PIL import Image
from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_transform from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_transform
from pytorch3d.renderer.mesh.rasterizer import MeshRasterizer, RasterizationSettings from pytorch3d.renderer.mesh.rasterizer import MeshRasterizer, RasterizationSettings
...@@ -20,6 +19,8 @@ from pytorch3d.renderer.points.rasterizer import ( ...@@ -20,6 +19,8 @@ from pytorch3d.renderer.points.rasterizer import (
from pytorch3d.structures import Pointclouds from pytorch3d.structures import Pointclouds
from pytorch3d.utils.ico_sphere import ico_sphere from pytorch3d.utils.ico_sphere import ico_sphere
from .common_testing import get_tests_dir
DATA_DIR = get_tests_dir() / "data" DATA_DIR = get_tests_dir() / "data"
DEBUG = False # Set DEBUG to true to save outputs from the tests. DEBUG = False # Set DEBUG to true to save outputs from the tests.
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
import unittest import unittest
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
from .common_testing import TestCaseMixin
class TestRaymarching(TestCaseMixin, unittest.TestCase): class TestRaymarching(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -8,7 +8,6 @@ import unittest ...@@ -8,7 +8,6 @@ import unittest
from typing import Callable from typing import Callable
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.common.compat import meshgrid_ij from pytorch3d.common.compat import meshgrid_ij
from pytorch3d.ops import eyes from pytorch3d.ops import eyes
from pytorch3d.renderer import ( from pytorch3d.renderer import (
...@@ -32,7 +31,9 @@ from pytorch3d.renderer.implicit.utils import ( ...@@ -32,7 +31,9 @@ from pytorch3d.renderer.implicit.utils import (
ray_bundle_variables_to_ray_points, ray_bundle_variables_to_ray_points,
) )
from pytorch3d.transforms import Rotate from pytorch3d.transforms import Rotate
from test_cameras import init_random_cameras
from .common_testing import TestCaseMixin
from .test_cameras import init_random_cameras
class TestNDCRaysamplerConvention(TestCaseMixin, unittest.TestCase): class TestNDCRaysamplerConvention(TestCaseMixin, unittest.TestCase):
......
...@@ -8,7 +8,6 @@ import unittest ...@@ -8,7 +8,6 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer import ( from pytorch3d.renderer import (
BlendParams, BlendParams,
EmissionAbsorptionRaymarcher, EmissionAbsorptionRaymarcher,
...@@ -28,7 +27,9 @@ from pytorch3d.renderer import ( ...@@ -28,7 +27,9 @@ from pytorch3d.renderer import (
) )
from pytorch3d.structures import Meshes from pytorch3d.structures import Meshes
from pytorch3d.utils import ico_sphere from pytorch3d.utils import ico_sphere
from test_render_volumes import init_cameras
from .common_testing import TestCaseMixin
from .test_render_volumes import init_cameras
DEBUG = False DEBUG = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment