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
...@@ -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.ops import corresponding_cameras_alignment from pytorch3d.ops import corresponding_cameras_alignment
from pytorch3d.renderer.cameras import ( from pytorch3d.renderer.cameras import (
OpenGLOrthographicCameras, OpenGLOrthographicCameras,
...@@ -18,7 +17,9 @@ from pytorch3d.renderer.cameras import ( ...@@ -18,7 +17,9 @@ from pytorch3d.renderer.cameras import (
) )
from pytorch3d.transforms.rotation_conversions import random_rotations from pytorch3d.transforms.rotation_conversions import random_rotations
from pytorch3d.transforms.so3 import so3_exp_map, so3_relative_angle from pytorch3d.transforms.so3 import so3_exp_map, so3_relative_angle
from test_cameras import init_random_cameras
from .common_testing import TestCaseMixin
from .test_cameras import init_random_cameras
class TestCamerasAlignment(TestCaseMixin, unittest.TestCase): class TestCamerasAlignment(TestCaseMixin, unittest.TestCase):
......
...@@ -10,10 +10,11 @@ from collections import namedtuple ...@@ -10,10 +10,11 @@ from collections import namedtuple
import numpy as np import numpy as np
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.loss import chamfer_distance from pytorch3d.loss import chamfer_distance
from pytorch3d.structures.pointclouds import Pointclouds from pytorch3d.structures.pointclouds import Pointclouds
from .common_testing import get_random_cuda_device, TestCaseMixin
# Output of init_pointclouds # Output of init_pointclouds
points_normals = namedtuple( points_normals = namedtuple(
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
import unittest import unittest
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.common.linear_with_repeat import LinearWithRepeat from pytorch3d.common.linear_with_repeat import LinearWithRepeat
from .common_testing import TestCaseMixin
class TestLinearWithRepeat(TestCaseMixin, unittest.TestCase): class TestLinearWithRepeat(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -8,7 +8,8 @@ import unittest ...@@ -8,7 +8,8 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from .common_testing import TestCaseMixin
class TestOpsUtils(TestCaseMixin, unittest.TestCase): class TestOpsUtils(TestCaseMixin, unittest.TestCase):
......
...@@ -9,9 +9,10 @@ import unittest ...@@ -9,9 +9,10 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.common.workaround import _safe_det_3x3 from pytorch3d.common.workaround import _safe_det_3x3
from .common_testing import TestCaseMixin
class TestSafeDet3x3(TestCaseMixin, unittest.TestCase): class TestSafeDet3x3(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
import unittest import unittest
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.renderer.compositing import ( from pytorch3d.renderer.compositing import (
alpha_composite, alpha_composite,
norm_weighted_sum, norm_weighted_sum,
weighted_sum, weighted_sum,
) )
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestAccumulatePoints(TestCaseMixin, unittest.TestCase): class TestAccumulatePoints(TestCaseMixin, unittest.TestCase):
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
import unittest import unittest
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.ops import cubify from pytorch3d.ops import cubify
from .common_testing import TestCaseMixin
class TestCubify(TestCaseMixin, unittest.TestCase): class TestCubify(TestCaseMixin, unittest.TestCase):
def test_allempty(self): def test_allempty(self):
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
import unittest import unittest
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.ops import mesh_face_areas_normals from pytorch3d.ops import mesh_face_areas_normals
from pytorch3d.structures.meshes import Meshes from pytorch3d.structures.meshes import Meshes
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestFaceAreasNormals(TestCaseMixin, unittest.TestCase): class TestFaceAreasNormals(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -8,12 +8,13 @@ import unittest ...@@ -8,12 +8,13 @@ import unittest
import torch import torch
import torch.nn as nn import torch.nn as nn
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d import _C from pytorch3d import _C
from pytorch3d.ops.graph_conv import gather_scatter, gather_scatter_python, GraphConv from pytorch3d.ops.graph_conv import gather_scatter, gather_scatter_python, GraphConv
from pytorch3d.structures.meshes import Meshes from pytorch3d.structures.meshes import Meshes
from pytorch3d.utils import ico_sphere from pytorch3d.utils import ico_sphere
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestGraphConv(TestCaseMixin, unittest.TestCase): class TestGraphConv(TestCaseMixin, unittest.TestCase):
def test_undirected(self): def test_undirected(self):
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
import unittest import unittest
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer.implicit import HarmonicEmbedding from pytorch3d.renderer.implicit import HarmonicEmbedding
from .common_testing import TestCaseMixin
class TestHarmonicEmbedding(TestCaseMixin, unittest.TestCase): class TestHarmonicEmbedding(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
import unittest import unittest
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.ops.interp_face_attrs import ( from pytorch3d.ops.interp_face_attrs import (
interpolate_face_attributes, interpolate_face_attributes,
interpolate_face_attributes_python, interpolate_face_attributes_python,
...@@ -16,6 +15,8 @@ from pytorch3d.renderer.mesh import TexturesVertex ...@@ -16,6 +15,8 @@ from pytorch3d.renderer.mesh import TexturesVertex
from pytorch3d.renderer.mesh.rasterizer import Fragments from pytorch3d.renderer.mesh.rasterizer import Fragments
from pytorch3d.structures import Meshes from pytorch3d.structures import Meshes
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestInterpolateFaceAttributes(TestCaseMixin, unittest.TestCase): class TestInterpolateFaceAttributes(TestCaseMixin, unittest.TestCase):
def _test_interp_face_attrs(self, interp_fun, device): def _test_interp_face_attrs(self, interp_fun, device):
......
...@@ -9,7 +9,6 @@ from math import radians ...@@ -9,7 +9,6 @@ from math import radians
import numpy as np import numpy as np
import torch import torch
from common_testing import get_pytorch3d_dir, get_tests_dir, TestCaseMixin
from PIL import Image from PIL import Image
from pytorch3d.io import IO from pytorch3d.io import IO
from pytorch3d.io.experimental_gltf_io import MeshGlbFormat from pytorch3d.io.experimental_gltf_io import MeshGlbFormat
...@@ -32,6 +31,8 @@ from pytorch3d.structures import Meshes ...@@ -32,6 +31,8 @@ from pytorch3d.structures import Meshes
from pytorch3d.transforms import axis_angle_to_matrix from pytorch3d.transforms import axis_angle_to_matrix
from pytorch3d.vis.texture_vis import texturesuv_image_PIL from pytorch3d.vis.texture_vis import texturesuv_image_PIL
from .common_testing import get_pytorch3d_dir, get_tests_dir, TestCaseMixin
DATA_DIR = get_tests_dir() / "data" DATA_DIR = get_tests_dir() / "data"
TUTORIAL_DATA_DIR = get_pytorch3d_dir() / "docs/tutorials/data" TUTORIAL_DATA_DIR = get_pytorch3d_dir() / "docs/tutorials/data"
......
...@@ -13,12 +13,6 @@ from pathlib import Path ...@@ -13,12 +13,6 @@ from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryDirectory from tempfile import NamedTemporaryFile, TemporaryDirectory
import torch import torch
from common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
from iopath.common.file_io import PathManager from iopath.common.file_io import PathManager
from pytorch3d.io import IO, load_obj, load_objs_as_meshes, save_obj from pytorch3d.io import IO, load_obj, load_objs_as_meshes, save_obj
from pytorch3d.io.mtl_io import ( from pytorch3d.io.mtl_io import (
...@@ -30,6 +24,13 @@ from pytorch3d.renderer import TexturesAtlas, TexturesUV, TexturesVertex ...@@ -30,6 +24,13 @@ from pytorch3d.renderer import TexturesAtlas, TexturesUV, TexturesVertex
from pytorch3d.structures import join_meshes_as_batch, Meshes from pytorch3d.structures import join_meshes_as_batch, Meshes
from pytorch3d.utils import torus from pytorch3d.utils import torus
from .common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
DATA_DIR = get_tests_dir() / "data" DATA_DIR = get_tests_dir() / "data"
TUTORIAL_DATA_DIR = get_pytorch3d_dir() / "docs/tutorials/data" TUTORIAL_DATA_DIR = get_pytorch3d_dir() / "docs/tutorials/data"
......
...@@ -8,11 +8,12 @@ import unittest ...@@ -8,11 +8,12 @@ import unittest
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.io import IO from pytorch3d.io import IO
from pytorch3d.renderer import TexturesAtlas, TexturesVertex from pytorch3d.renderer import TexturesAtlas, TexturesVertex
from pytorch3d.utils import ico_sphere from pytorch3d.utils import ico_sphere
from .common_testing import TestCaseMixin
CUBE_FACES = [ CUBE_FACES = [
[0, 1, 2], [0, 1, 2],
......
...@@ -13,7 +13,6 @@ from tempfile import NamedTemporaryFile, TemporaryFile ...@@ -13,7 +13,6 @@ from tempfile import NamedTemporaryFile, TemporaryFile
import numpy as np import numpy as np
import pytorch3d.io.ply_io import pytorch3d.io.ply_io
import torch import torch
from common_testing import TestCaseMixin
from iopath.common.file_io import PathManager from iopath.common.file_io import PathManager
from pytorch3d.io import IO from pytorch3d.io import IO
from pytorch3d.io.ply_io import load_ply, save_ply from pytorch3d.io.ply_io import load_ply, save_ply
...@@ -21,6 +20,8 @@ from pytorch3d.renderer.mesh import TexturesVertex ...@@ -21,6 +20,8 @@ from pytorch3d.renderer.mesh import TexturesVertex
from pytorch3d.structures import Meshes, Pointclouds from pytorch3d.structures import Meshes, Pointclouds
from pytorch3d.utils import torus from pytorch3d.utils import torus
from .common_testing import TestCaseMixin
global_path_manager = PathManager() global_path_manager = PathManager()
......
...@@ -11,11 +11,12 @@ from typing import List, Tuple, Union ...@@ -11,11 +11,12 @@ from typing import List, Tuple, Union
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
from common_testing import get_random_cuda_device, get_tests_dir, TestCaseMixin
from pytorch3d.io import save_obj from pytorch3d.io import save_obj
from pytorch3d.ops.iou_box3d import _box_planes, _box_triangles, box3d_overlap from pytorch3d.ops.iou_box3d import _box_planes, _box_triangles, box3d_overlap
from pytorch3d.transforms.rotation_conversions import random_rotation from pytorch3d.transforms.rotation_conversions import random_rotation
from .common_testing import get_random_cuda_device, get_tests_dir, TestCaseMixin
OBJECTRON_TO_PYTORCH3D_FACE_IDX = [0, 4, 6, 2, 1, 5, 7, 3] OBJECTRON_TO_PYTORCH3D_FACE_IDX = [0, 4, 6, 2, 1, 5, 7, 3]
DATA_DIR = get_tests_dir() / "data" DATA_DIR = get_tests_dir() / "data"
......
...@@ -8,9 +8,10 @@ import unittest ...@@ -8,9 +8,10 @@ import unittest
from itertools import product from itertools import product
import torch import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.ops.knn import _KNN, knn_gather, knn_points from pytorch3d.ops.knn import _KNN, knn_gather, knn_points
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestKNN(TestCaseMixin, unittest.TestCase): class TestKNN(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 cot_laplacian, laplacian, norm_laplacian from pytorch3d.ops import cot_laplacian, laplacian, norm_laplacian
from pytorch3d.structures.meshes import Meshes from pytorch3d.structures.meshes import Meshes
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestLaplacianMatrices(TestCaseMixin, unittest.TestCase): class TestLaplacianMatrices(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
......
...@@ -8,10 +8,11 @@ import unittest ...@@ -8,10 +8,11 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer.lighting import AmbientLights, DirectionalLights, PointLights from pytorch3d.renderer.lighting import AmbientLights, DirectionalLights, PointLights
from pytorch3d.transforms import RotateAxisAngle from pytorch3d.transforms import RotateAxisAngle
from .common_testing import TestCaseMixin
class TestLights(TestCaseMixin, unittest.TestCase): class TestLights(TestCaseMixin, unittest.TestCase):
def test_init_lights(self): def test_init_lights(self):
......
...@@ -9,9 +9,10 @@ import pickle ...@@ -9,9 +9,10 @@ import pickle
import unittest import unittest
import torch import torch
from common_testing import get_tests_dir, TestCaseMixin
from pytorch3d.ops.marching_cubes import marching_cubes_naive from pytorch3d.ops.marching_cubes import marching_cubes_naive
from .common_testing import get_tests_dir, TestCaseMixin
USE_SCIKIT = False USE_SCIKIT = False
DATA_DIR = get_tests_dir() / "data" DATA_DIR = get_tests_dir() / "data"
......
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