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
......@@ -14,12 +14,6 @@ from collections import namedtuple
import numpy as np
import torch
from common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
from PIL import Image
from pytorch3d.io import load_obj
from pytorch3d.renderer.cameras import (
......@@ -52,6 +46,13 @@ from pytorch3d.structures.meshes import (
from pytorch3d.utils.ico_sphere import ico_sphere
from pytorch3d.utils.torus import torus
from .common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
# If DEBUG=True, save out images generated in the tests for debugging.
# All saved images have prefix DEBUG_
......
......@@ -17,7 +17,6 @@ import unittest
import imageio
import numpy as np
import torch
from common_testing import get_tests_dir, load_rgb_image, TestCaseMixin
from pytorch3d.io import save_obj
from pytorch3d.renderer.cameras import (
FoVPerspectiveCameras,
......@@ -39,6 +38,8 @@ from pytorch3d.renderer.mesh.textures import TexturesVertex
from pytorch3d.structures.meshes import Meshes
from pytorch3d.utils import torus
from .common_testing import get_tests_dir, load_rgb_image, TestCaseMixin
# If DEBUG=True, save out images generated in the tests for debugging.
# All saved images have prefix DEBUG_
......
......@@ -8,7 +8,6 @@ import unittest
import torch
import torch.nn as nn
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.renderer import (
AlphaCompositor,
BlendParams,
......@@ -28,6 +27,8 @@ from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_trans
from pytorch3d.structures import Meshes, Pointclouds
from pytorch3d.utils.ico_sphere import ico_sphere
from .common_testing import get_random_cuda_device, TestCaseMixin
# Set the number of GPUS you want to test with
NUM_GPUS = 3
......
......@@ -14,12 +14,6 @@ from os import path
import numpy as np
import torch
from common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
from PIL import Image
from pytorch3d.renderer.cameras import (
FoVOrthographicCameras,
......@@ -40,6 +34,13 @@ from pytorch3d.renderer.points import (
from pytorch3d.structures.pointclouds import Pointclouds
from pytorch3d.utils.ico_sphere import ico_sphere
from .common_testing import (
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
# If DEBUG=True, save out images generated in the tests for debugging.
# All saved images have prefix DEBUG_
......
......@@ -9,7 +9,6 @@ from typing import Optional, Tuple
import numpy as np
import torch
from common_testing import TestCaseMixin
from pytorch3d.ops import knn_points
from pytorch3d.renderer import (
AbsorptionOnlyRaymarcher,
......@@ -28,7 +27,9 @@ from pytorch3d.renderer import (
)
from pytorch3d.renderer.implicit.utils import _validate_ray_bundle_variables
from pytorch3d.structures import Pointclouds, Volumes
from test_points_to_volumes import init_uniform_y_rotations
from .common_testing import TestCaseMixin
from .test_points_to_volumes import init_uniform_y_rotations
DEBUG = False
......
......@@ -9,7 +9,6 @@ import unittest
import numpy as np
import torch
from common_testing import TestCaseMixin
from pytorch3d.common.compat import meshgrid_ij
from pytorch3d.ops import eyes
from pytorch3d.renderer import (
......@@ -26,6 +25,8 @@ from pytorch3d.renderer.utils import (
)
from pytorch3d.structures import Pointclouds
from .common_testing import TestCaseMixin
# Example class for testing
class TensorPropertiesTestClass(TensorProperties):
......
......@@ -13,7 +13,6 @@ from typing import Optional, Union
import numpy as np
import torch
from common_testing import TestCaseMixin
from pytorch3d.transforms.rotation_conversions import (
axis_angle_to_matrix,
axis_angle_to_quaternion,
......@@ -32,6 +31,8 @@ from pytorch3d.transforms.rotation_conversions import (
rotation_6d_to_matrix,
)
from .common_testing import TestCaseMixin
class TestRandomRotation(unittest.TestCase):
def setUp(self) -> None:
......
......@@ -8,12 +8,6 @@ import unittest
import numpy as np
import torch
from common_testing import (
get_pytorch3d_dir,
get_random_cuda_device,
get_tests_dir,
TestCaseMixin,
)
from pytorch3d.io import load_obj
from pytorch3d.ops.sample_farthest_points import (
sample_farthest_points,
......@@ -21,6 +15,13 @@ from pytorch3d.ops.sample_farthest_points import (
)
from pytorch3d.ops.utils import masked_gather
from .common_testing import (
get_pytorch3d_dir,
get_random_cuda_device,
get_tests_dir,
TestCaseMixin,
)
DATA_DIR = get_tests_dir() / "data"
TUTORIAL_DATA_DIR = get_pytorch3d_dir() / "docs/tutorials/data"
......
......@@ -8,9 +8,10 @@ import unittest
from itertools import product
import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer.implicit.sample_pdf import sample_pdf, sample_pdf_python
from .common_testing import TestCaseMixin
class TestSamplePDF(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None:
......
......@@ -9,12 +9,6 @@ import unittest
import numpy as np
import torch
from common_testing import (
get_pytorch3d_dir,
get_random_cuda_device,
get_tests_dir,
TestCaseMixin,
)
from PIL import Image
from pytorch3d.io import load_objs_as_meshes
from pytorch3d.ops import sample_points_from_meshes
......@@ -30,6 +24,13 @@ from pytorch3d.renderer.points import (
from pytorch3d.structures import Meshes, Pointclouds
from pytorch3d.utils.ico_sphere import ico_sphere
from .common_testing import (
get_pytorch3d_dir,
get_random_cuda_device,
get_tests_dir,
TestCaseMixin,
)
# If DEBUG=True, save out images generated in the tests for debugging.
# All saved images have prefix DEBUG_
......
......@@ -9,12 +9,13 @@ import unittest
import numpy as np
import torch
from common_testing import TestCaseMixin
from pytorch3d.common.compat import qr
from pytorch3d.transforms.rotation_conversions import random_rotations
from pytorch3d.transforms.se3 import se3_exp_map, se3_log_map
from pytorch3d.transforms.so3 import so3_exp_map, so3_log_map, so3_rotation_angle
from .common_testing import TestCaseMixin
class TestSE3(TestCaseMixin, unittest.TestCase):
precomputed_log_transform = torch.tensor(
......
......@@ -7,7 +7,6 @@
import unittest
import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras
from pytorch3d.renderer.mesh.rasterizer import Fragments
from pytorch3d.renderer.mesh.shader import (
......@@ -18,6 +17,8 @@ from pytorch3d.renderer.mesh.shader import (
)
from pytorch3d.structures.meshes import Meshes
from .common_testing import TestCaseMixin
class TestShader(TestCaseMixin, unittest.TestCase):
def test_to(self):
......
......@@ -12,7 +12,6 @@ import unittest
import numpy as np
import torch
from common_testing import get_tests_dir, load_rgb_image, TestCaseMixin
from PIL import Image
from pytorch3d.datasets import collate_batched_meshes, ShapeNetCore
from pytorch3d.renderer import (
......@@ -23,6 +22,8 @@ from pytorch3d.renderer import (
)
from torch.utils.data import DataLoader
from .common_testing import get_tests_dir, load_rgb_image, TestCaseMixin
# Set the SHAPENET_PATH to the local path to the dataset
SHAPENET_PATH = None
......
......@@ -11,7 +11,6 @@ from distutils.version import LooseVersion
import numpy as np
import torch
from common_testing import TestCaseMixin
from pytorch3d.common.compat import qr
from pytorch3d.transforms.so3 import (
hat,
......@@ -21,6 +20,8 @@ from pytorch3d.transforms.so3 import (
so3_rotation_angle,
)
from .common_testing import TestCaseMixin
class TestSO3(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None:
......
......@@ -8,9 +8,10 @@
import unittest
import torch
from common_testing import TestCaseMixin
from pytorch3d.structures import utils as struct_utils
from .common_testing import TestCaseMixin
class TestStructUtils(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None:
......
......@@ -8,11 +8,12 @@
import unittest
import torch
from common_testing import TestCaseMixin
from pytorch3d.ops.subdivide_meshes import SubdivideMeshes
from pytorch3d.structures.meshes import Meshes
from pytorch3d.utils.ico_sphere import ico_sphere
from .common_testing import TestCaseMixin
class TestSubdivideMeshes(TestCaseMixin, unittest.TestCase):
def simple_subdivide(self, with_init=False):
......
......@@ -8,10 +8,11 @@
import unittest
import torch
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.common.workaround import symeig3x3
from pytorch3d.transforms.rotation_conversions import random_rotations
from .common_testing import get_random_cuda_device, TestCaseMixin
class TestSymEig3x3(TestCaseMixin, unittest.TestCase):
TEST_BATCH_SIZE = 1024
......
......@@ -9,7 +9,6 @@ import unittest
import torch
import torch.nn.functional as F
from common_testing import TestCaseMixin
from pytorch3d.renderer.mesh.rasterizer import Fragments
from pytorch3d.renderer.mesh.textures import (
_list_to_padded_wrapper,
......@@ -23,7 +22,9 @@ from pytorch3d.renderer.mesh.utils import (
Rectangle,
)
from pytorch3d.structures import list_to_packed, Meshes, packed_to_list
from test_meshes import init_mesh
from .common_testing import TestCaseMixin
from .test_meshes import init_mesh
def tryindex(self, index, tex, meshes, source):
......
......@@ -9,7 +9,6 @@ import math
import unittest
import torch
from common_testing import TestCaseMixin
from pytorch3d.transforms import random_rotations
from pytorch3d.transforms.so3 import so3_exp_map
from pytorch3d.transforms.transform3d import (
......@@ -20,6 +19,8 @@ from pytorch3d.transforms.transform3d import (
Translate,
)
from .common_testing import TestCaseMixin
class TestTransform(TestCaseMixin, unittest.TestCase):
def setUp(self) -> None:
......
......@@ -9,11 +9,12 @@ import unittest
import torch
import torch.nn.functional as F
from common_testing import TestCaseMixin
from pytorch3d.ops.vert_align import vert_align
from pytorch3d.structures.meshes import Meshes
from pytorch3d.structures.pointclouds import Pointclouds
from .common_testing import TestCaseMixin
class TestVertAlign(TestCaseMixin, unittest.TestCase):
@staticmethod
......
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