mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 03:42:50 +08:00
move targets
Summary: Move testing targets from pytorch3d/tests/TARGETS to pytorch3d/TARGETS. Reviewed By: shapovalov Differential Revision: D36186940 fbshipit-source-id: a4c52c4d99351f885e2b0bf870532d530324039b
This commit is contained in:
parent
f625fe1f8b
commit
34f648ede0
@ -10,7 +10,7 @@
|
|||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
DIR=$(dirname "${DIR}")
|
DIR=$(dirname "${DIR}")
|
||||||
|
|
||||||
if [[ -f "${DIR}/tests/TARGETS" ]]
|
if [[ -f "${DIR}/TARGETS" ]]
|
||||||
then
|
then
|
||||||
pyfmt "${DIR}"
|
pyfmt "${DIR}"
|
||||||
else
|
else
|
||||||
@ -30,7 +30,7 @@ clangformat=$(command -v clang-format-8 || echo clang-format)
|
|||||||
find "${DIR}" -regex ".*\.\(cpp\|c\|cc\|cu\|cuh\|cxx\|h\|hh\|hpp\|hxx\|tcc\|mm\|m\)" -print0 | xargs -0 "${clangformat}" -i
|
find "${DIR}" -regex ".*\.\(cpp\|c\|cc\|cu\|cuh\|cxx\|h\|hh\|hpp\|hxx\|tcc\|mm\|m\)" -print0 | xargs -0 "${clangformat}" -i
|
||||||
|
|
||||||
# Run arc and pyre internally only.
|
# Run arc and pyre internally only.
|
||||||
if [[ -f "${DIR}/tests/TARGETS" ]]
|
if [[ -f "${DIR}/TARGETS" ]]
|
||||||
then
|
then
|
||||||
(cd "${DIR}"; command -v arc > /dev/null && arc lint) || true
|
(cd "${DIR}"; command -v arc > /dev/null && arc lint) || true
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ def tests_from_file(path: Path, base: str) -> List[str]:
|
|||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
files = get_test_files()
|
files = get_test_files()
|
||||||
test_root = Path(__file__).parent.parent / "tests"
|
test_root = Path(__file__).parent.parent
|
||||||
all_tests = []
|
all_tests = []
|
||||||
for f in files:
|
for f in files:
|
||||||
file_base = str(f.relative_to(test_root))[:-3].replace("/", ".")
|
file_base = str(f.relative_to(test_root))[:-3].replace("/", ".")
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_acos_linear_extrapolation import TestAcosLinearExtrapolation
|
from tests.test_acos_linear_extrapolation import TestAcosLinearExtrapolation
|
||||||
|
|
||||||
|
|
||||||
def bm_acos_linear_extrapolation() -> None:
|
def bm_acos_linear_extrapolation() -> None:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_ball_query import TestBallQuery
|
from tests.test_ball_query import TestBallQuery
|
||||||
|
|
||||||
|
|
||||||
def bm_ball_query() -> None:
|
def bm_ball_query() -> None:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_blending import TestBlending
|
from tests.test_blending import TestBlending
|
||||||
|
|
||||||
|
|
||||||
def bm_blending() -> None:
|
def bm_blending() -> None:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_cameras_alignment import TestCamerasAlignment
|
from tests.test_cameras_alignment import TestCamerasAlignment
|
||||||
|
|
||||||
|
|
||||||
def bm_cameras_alignment() -> None:
|
def bm_cameras_alignment() -> None:
|
||||||
|
@ -8,7 +8,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_chamfer import TestChamfer
|
from tests.test_chamfer import TestChamfer
|
||||||
|
|
||||||
|
|
||||||
def bm_chamfer() -> None:
|
def bm_chamfer() -> None:
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_cubify import TestCubify
|
from tests.test_cubify import TestCubify
|
||||||
|
|
||||||
|
|
||||||
def bm_cubify() -> None:
|
def bm_cubify() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_face_areas_normals import TestFaceAreasNormals
|
from tests.test_face_areas_normals import TestFaceAreasNormals
|
||||||
|
|
||||||
|
|
||||||
def bm_face_areas_normals() -> None:
|
def bm_face_areas_normals() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_graph_conv import TestGraphConv
|
from tests.test_graph_conv import TestGraphConv
|
||||||
|
|
||||||
|
|
||||||
def bm_graph_conv() -> None:
|
def bm_graph_conv() -> None:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_iou_box3d import TestIoU3D
|
from tests.test_iou_box3d import TestIoU3D
|
||||||
|
|
||||||
|
|
||||||
def bm_iou_box3d() -> None:
|
def bm_iou_box3d() -> None:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_knn import TestKNN
|
from tests.test_knn import TestKNN
|
||||||
|
|
||||||
|
|
||||||
def bm_knn() -> None:
|
def bm_knn() -> None:
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_marching_cubes import TestMarchingCubes
|
from tests.test_marching_cubes import TestMarchingCubes
|
||||||
|
|
||||||
|
|
||||||
def bm_marching_cubes() -> None:
|
def bm_marching_cubes() -> None:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_mesh_edge_loss import TestMeshEdgeLoss
|
from tests.test_mesh_edge_loss import TestMeshEdgeLoss
|
||||||
|
|
||||||
|
|
||||||
def bm_mesh_edge_loss() -> None:
|
def bm_mesh_edge_loss() -> None:
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_io_obj import TestMeshObjIO
|
from tests.test_io_obj import TestMeshObjIO
|
||||||
from test_io_ply import TestMeshPlyIO
|
from tests.test_io_ply import TestMeshPlyIO
|
||||||
|
|
||||||
|
|
||||||
def bm_save_load() -> None:
|
def bm_save_load() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_mesh_laplacian_smoothing import TestLaplacianSmoothing
|
from tests.test_mesh_laplacian_smoothing import TestLaplacianSmoothing
|
||||||
|
|
||||||
|
|
||||||
def bm_mesh_laplacian_smoothing() -> None:
|
def bm_mesh_laplacian_smoothing() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_mesh_normal_consistency import TestMeshNormalConsistency
|
from tests.test_mesh_normal_consistency import TestMeshNormalConsistency
|
||||||
|
|
||||||
|
|
||||||
def bm_mesh_normal_consistency() -> None:
|
def bm_mesh_normal_consistency() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_meshes import TestMeshes
|
from tests.test_meshes import TestMeshes
|
||||||
|
|
||||||
|
|
||||||
def bm_compute_packed_padded_meshes() -> None:
|
def bm_compute_packed_padded_meshes() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_packed_to_padded import TestPackedToPadded
|
from tests.test_packed_to_padded import TestPackedToPadded
|
||||||
|
|
||||||
|
|
||||||
def bm_packed_to_padded() -> None:
|
def bm_packed_to_padded() -> None:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_perspective_n_points import TestPerspectiveNPoints
|
from tests.test_perspective_n_points import TestPerspectiveNPoints
|
||||||
|
|
||||||
|
|
||||||
def bm_perspective_n_points() -> None:
|
def bm_perspective_n_points() -> None:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_point_mesh_distance import TestPointMeshDistance
|
from tests.test_point_mesh_distance import TestPointMeshDistance
|
||||||
|
|
||||||
|
|
||||||
def bm_point_mesh_distance() -> None:
|
def bm_point_mesh_distance() -> None:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_pointclouds import TestPointclouds
|
from tests.test_pointclouds import TestPointclouds
|
||||||
|
|
||||||
|
|
||||||
def bm_compute_packed_padded_pointclouds() -> None:
|
def bm_compute_packed_padded_pointclouds() -> None:
|
||||||
|
@ -8,7 +8,7 @@ from copy import deepcopy
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_points_alignment import TestCorrespondingPointsAlignment, TestICP
|
from tests.test_points_alignment import TestCorrespondingPointsAlignment, TestICP
|
||||||
|
|
||||||
|
|
||||||
def bm_iterative_closest_point() -> None:
|
def bm_iterative_closest_point() -> None:
|
||||||
|
@ -9,7 +9,7 @@ import itertools
|
|||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from pytorch3d.ops import estimate_pointcloud_normals
|
from pytorch3d.ops import estimate_pointcloud_normals
|
||||||
from test_points_normals import TestPCLNormals
|
from tests.test_points_normals import TestPCLNormals
|
||||||
|
|
||||||
|
|
||||||
def to_bm(num_points, use_symeig_workaround):
|
def to_bm(num_points, use_symeig_workaround):
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_points_to_volumes import TestPointsToVolumes
|
from tests.test_points_to_volumes import TestPointsToVolumes
|
||||||
|
|
||||||
|
|
||||||
def bm_points_to_volumes() -> None:
|
def bm_points_to_volumes() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_rasterize_meshes import TestRasterizeMeshes
|
from tests.test_rasterize_meshes import TestRasterizeMeshes
|
||||||
|
|
||||||
|
|
||||||
# ico levels:
|
# ico levels:
|
||||||
|
@ -8,7 +8,7 @@ import itertools
|
|||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
|
from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
|
||||||
from test_raymarching import TestRaymarching
|
from tests.test_raymarching import TestRaymarching
|
||||||
|
|
||||||
|
|
||||||
def bm_raymarching() -> None:
|
def bm_raymarching() -> None:
|
||||||
|
@ -16,7 +16,7 @@ from pytorch3d.renderer import (
|
|||||||
OrthographicCameras,
|
OrthographicCameras,
|
||||||
PerspectiveCameras,
|
PerspectiveCameras,
|
||||||
)
|
)
|
||||||
from test_raysampling import TestRaysampling
|
from tests.test_raysampling import TestRaysampling
|
||||||
|
|
||||||
|
|
||||||
def bm_raysampling() -> None:
|
def bm_raysampling() -> None:
|
||||||
|
@ -8,7 +8,7 @@ import itertools
|
|||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
|
from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
|
||||||
from test_render_implicit import TestRenderImplicit
|
from tests.test_render_implicit import TestRenderImplicit
|
||||||
|
|
||||||
|
|
||||||
def bm_render_volumes() -> None:
|
def bm_render_volumes() -> None:
|
||||||
|
@ -8,7 +8,7 @@ import itertools
|
|||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
|
from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
|
||||||
from test_render_volumes import TestRenderVolumes
|
from tests.test_render_volumes import TestRenderVolumes
|
||||||
|
|
||||||
|
|
||||||
def bm_render_volumes() -> None:
|
def bm_render_volumes() -> None:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_sample_farthest_points import TestFPS
|
from tests.test_sample_farthest_points import TestFPS
|
||||||
|
|
||||||
|
|
||||||
def bm_fps() -> None:
|
def bm_fps() -> None:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_sample_pdf import TestSamplePDF
|
from tests.test_sample_pdf import TestSamplePDF
|
||||||
|
|
||||||
|
|
||||||
def bm_sample_pdf() -> None:
|
def bm_sample_pdf() -> None:
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_sample_points_from_meshes import TestSamplePoints
|
from tests.test_sample_points_from_meshes import TestSamplePoints
|
||||||
|
|
||||||
|
|
||||||
def bm_sample_points() -> None:
|
def bm_sample_points() -> None:
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_se3 import TestSE3
|
from tests.test_se3 import TestSE3
|
||||||
|
|
||||||
|
|
||||||
def bm_se3() -> None:
|
def bm_se3() -> None:
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_so3 import TestSO3
|
from tests.test_so3 import TestSO3
|
||||||
|
|
||||||
|
|
||||||
def bm_so3() -> None:
|
def bm_so3() -> None:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
|
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_subdivide_meshes import TestSubdivideMeshes
|
from tests.test_subdivide_meshes import TestSubdivideMeshes
|
||||||
|
|
||||||
|
|
||||||
def bm_subdivide() -> None:
|
def bm_subdivide() -> None:
|
||||||
|
@ -12,7 +12,7 @@ import torch
|
|||||||
from common_testing import get_random_cuda_device
|
from common_testing import get_random_cuda_device
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from pytorch3d.common.workaround import symeig3x3
|
from pytorch3d.common.workaround import symeig3x3
|
||||||
from test_symeig3x3 import TestSymEig3x3
|
from tests.test_symeig3x3 import TestSymEig3x3
|
||||||
|
|
||||||
|
|
||||||
torch.set_num_threads(1)
|
torch.set_num_threads(1)
|
||||||
|
@ -9,7 +9,7 @@ from itertools import product
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from fvcore.common.benchmark import benchmark
|
from fvcore.common.benchmark import benchmark
|
||||||
from test_vert_align import TestVertAlign
|
from tests.test_vert_align import TestVertAlign
|
||||||
|
|
||||||
|
|
||||||
def bm_vert_align() -> None:
|
def bm_vert_align() -> None:
|
||||||
|
@ -38,7 +38,7 @@ def get_pytorch3d_dir() -> Path:
|
|||||||
Meta internal systems need a special case here.
|
Meta internal systems need a special case here.
|
||||||
"""
|
"""
|
||||||
if os.environ.get("INSIDE_RE_WORKER") is not None:
|
if os.environ.get("INSIDE_RE_WORKER") is not None:
|
||||||
return Path(__file__).resolve().parent
|
return Path(__file__).resolve().parent.parent
|
||||||
elif os.environ.get("CONDA_BUILD_STATE", "") == "TEST":
|
elif os.environ.get("CONDA_BUILD_STATE", "") == "TEST":
|
||||||
return Path(os.environ["SRC_DIR"])
|
return Path(os.environ["SRC_DIR"])
|
||||||
else:
|
else:
|
||||||
|
@ -5,16 +5,11 @@
|
|||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
import unittest.mock
|
import unittest.mock
|
||||||
|
|
||||||
|
from tests.common_testing import get_pytorch3d_dir
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import get_pytorch3d_dir
|
|
||||||
else:
|
|
||||||
from tests.common_testing import get_pytorch3d_dir
|
|
||||||
|
|
||||||
|
|
||||||
# This file groups together tests which look at the code without running it.
|
# This file groups together tests which look at the code without running it.
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the BSD-style license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
from math import pi
|
from math import pi
|
||||||
|
|
||||||
@ -15,12 +14,7 @@ from pytorch3d.implicitron.tools.circle_fitting import (
|
|||||||
fit_circle_in_3d,
|
fit_circle_in_3d,
|
||||||
)
|
)
|
||||||
from pytorch3d.transforms import random_rotation
|
from pytorch3d.transforms import random_rotation
|
||||||
|
from tests.common_testing import TestCaseMixin
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
else:
|
|
||||||
from tests.common_testing import TestCaseMixin
|
|
||||||
|
|
||||||
|
|
||||||
class TestCircleFitting(TestCaseMixin, unittest.TestCase):
|
class TestCircleFitting(TestCaseMixin, unittest.TestCase):
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the BSD-style license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from omegaconf import OmegaConf
|
from omegaconf import OmegaConf
|
||||||
@ -30,15 +29,9 @@ from pytorch3d.implicitron.tools.config import (
|
|||||||
get_default_args,
|
get_default_args,
|
||||||
remove_unused_components,
|
remove_unused_components,
|
||||||
)
|
)
|
||||||
|
from tests.common_testing import get_tests_dir
|
||||||
|
|
||||||
|
from .common_resources import provide_resnet34
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import get_tests_dir
|
|
||||||
|
|
||||||
from .common_resources import provide_resnet34
|
|
||||||
else:
|
|
||||||
from common_resources import provide_resnet34
|
|
||||||
from tests.common_testing import get_tests_dir
|
|
||||||
|
|
||||||
DATA_DIR = get_tests_dir() / "implicitron/data"
|
DATA_DIR = get_tests_dir() / "implicitron/data"
|
||||||
DEBUG: bool = False
|
DEBUG: bool = False
|
||||||
|
@ -4,17 +4,12 @@
|
|||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the BSD-style license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from omegaconf import OmegaConf
|
from omegaconf import OmegaConf
|
||||||
from pytorch3d.implicitron.dataset.data_source import ImplicitronDataSource
|
from pytorch3d.implicitron.dataset.data_source import ImplicitronDataSource
|
||||||
from pytorch3d.implicitron.tools.config import get_default_args
|
from pytorch3d.implicitron.tools.config import get_default_args
|
||||||
|
from tests.common_testing import get_tests_dir
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import get_tests_dir
|
|
||||||
else:
|
|
||||||
from tests.common_testing import get_tests_dir
|
|
||||||
|
|
||||||
DATA_DIR = get_tests_dir() / "implicitron/data"
|
DATA_DIR = get_tests_dir() / "implicitron/data"
|
||||||
DEBUG: bool = False
|
DEBUG: bool = False
|
||||||
|
@ -21,15 +21,9 @@ from pytorch3d.vis.plotly_vis import plot_scene
|
|||||||
if os.environ.get("INSIDE_RE_WORKER") is None:
|
if os.environ.get("INSIDE_RE_WORKER") is None:
|
||||||
from visdom import Visdom
|
from visdom import Visdom
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
from tests.common_testing import interactive_testing_requested
|
||||||
from .common_resources import get_skateboard_data
|
|
||||||
else:
|
|
||||||
from common_resources import get_skateboard_data
|
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
from .common_resources import get_skateboard_data
|
||||||
from common_testing import interactive_testing_requested
|
|
||||||
else:
|
|
||||||
from tests.common_testing import interactive_testing_requested
|
|
||||||
|
|
||||||
|
|
||||||
class TestDatasetVisualize(unittest.TestCase):
|
class TestDatasetVisualize(unittest.TestCase):
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the BSD-style license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
@ -13,12 +12,7 @@ from pytorch3d.implicitron.tools.eval_video_trajectory import (
|
|||||||
)
|
)
|
||||||
from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras
|
from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras
|
||||||
from pytorch3d.transforms import axis_angle_to_matrix
|
from pytorch3d.transforms import axis_angle_to_matrix
|
||||||
|
from tests.common_testing import TestCaseMixin
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
else:
|
|
||||||
from tests.common_testing import TestCaseMixin
|
|
||||||
|
|
||||||
|
|
||||||
class TestEvalCameras(TestCaseMixin, unittest.TestCase):
|
class TestEvalCameras(TestCaseMixin, unittest.TestCase):
|
||||||
|
@ -9,16 +9,9 @@ import unittest
|
|||||||
|
|
||||||
from pytorch3d.implicitron import eval_demo
|
from pytorch3d.implicitron import eval_demo
|
||||||
|
|
||||||
|
from tests.common_testing import interactive_testing_requested
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
from .common_resources import CO3D_MANIFOLD_PATH, get_path_manager
|
||||||
from .common_resources import CO3D_MANIFOLD_PATH, get_path_manager
|
|
||||||
else:
|
|
||||||
from common_resources import CO3D_MANIFOLD_PATH, get_path_manager
|
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import interactive_testing_requested
|
|
||||||
else:
|
|
||||||
from tests.common_testing import interactive_testing_requested
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This test runs a single sequence eval_demo, useful for debugging datasets.
|
This test runs a single sequence eval_demo, useful for debugging datasets.
|
||||||
|
@ -13,16 +13,9 @@ from pytorch3d.implicitron.models.generic_model import GenericModel
|
|||||||
from pytorch3d.implicitron.models.renderer.base import EvaluationMode
|
from pytorch3d.implicitron.models.renderer.base import EvaluationMode
|
||||||
from pytorch3d.implicitron.tools.config import expand_args_fields, get_default_args
|
from pytorch3d.implicitron.tools.config import expand_args_fields, get_default_args
|
||||||
from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras
|
from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras
|
||||||
|
from tests.common_testing import get_pytorch3d_dir
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
from .common_resources import provide_resnet34
|
||||||
from .common_resources import provide_resnet34
|
|
||||||
else:
|
|
||||||
from common_resources import provide_resnet34
|
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import get_pytorch3d_dir
|
|
||||||
else:
|
|
||||||
from tests.common_testing import get_pytorch3d_dir
|
|
||||||
|
|
||||||
IMPLICITRON_CONFIGS_DIR = (
|
IMPLICITRON_CONFIGS_DIR = (
|
||||||
get_pytorch3d_dir() / "projects" / "implicitron_trainer" / "configs"
|
get_pytorch3d_dir() / "projects" / "implicitron_trainer" / "configs"
|
||||||
|
@ -4,18 +4,12 @@
|
|||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the BSD-style license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from pytorch3d.implicitron.models.renderer.ray_point_refiner import RayPointRefiner
|
from pytorch3d.implicitron.models.renderer.ray_point_refiner import RayPointRefiner
|
||||||
from pytorch3d.renderer import RayBundle
|
from pytorch3d.renderer import RayBundle
|
||||||
|
from tests.common_testing import TestCaseMixin
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
else:
|
|
||||||
from tests.common_testing import TestCaseMixin
|
|
||||||
|
|
||||||
|
|
||||||
class TestRayPointRefiner(TestCaseMixin, unittest.TestCase):
|
class TestRayPointRefiner(TestCaseMixin, unittest.TestCase):
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the BSD-style license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
@ -16,12 +15,7 @@ from pytorch3d.implicitron.models.implicit_function.scene_representation_network
|
|||||||
from pytorch3d.implicitron.models.renderer.base import ImplicitFunctionWrapper
|
from pytorch3d.implicitron.models.renderer.base import ImplicitFunctionWrapper
|
||||||
from pytorch3d.implicitron.tools.config import get_default_args
|
from pytorch3d.implicitron.tools.config import get_default_args
|
||||||
from pytorch3d.renderer import RayBundle
|
from pytorch3d.renderer import RayBundle
|
||||||
|
from tests.common_testing import TestCaseMixin
|
||||||
|
|
||||||
if os.environ.get("FB_TEST", False):
|
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
else:
|
|
||||||
from tests.common_testing import TestCaseMixin
|
|
||||||
|
|
||||||
_BATCH_SIZE: int = 3
|
_BATCH_SIZE: int = 3
|
||||||
_N_RAYS: int = 100
|
_N_RAYS: int = 100
|
||||||
|
@ -12,12 +12,7 @@ from os import path
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
from ..common_testing import TestCaseMixin
|
||||||
# fmt: off
|
|
||||||
# Make the mixin available.
|
|
||||||
sys.path.insert(0, path.join(path.dirname(__file__), ".."))
|
|
||||||
from common_testing import TestCaseMixin # isort:skip # noqa: E402
|
|
||||||
# fmt: on
|
|
||||||
|
|
||||||
|
|
||||||
sys.path.insert(0, path.join(path.dirname(__file__), "..", ".."))
|
sys.path.insert(0, path.join(path.dirname(__file__), "..", ".."))
|
||||||
|
@ -15,12 +15,7 @@ import imageio
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
from ..common_testing import TestCaseMixin
|
||||||
# fmt: off
|
|
||||||
# Make the mixin available.
|
|
||||||
sys.path.insert(0, path.join(path.dirname(__file__), ".."))
|
|
||||||
from common_testing import TestCaseMixin # isort:skip # noqa: E402
|
|
||||||
# fmt: on
|
|
||||||
|
|
||||||
# Making sure you can run this, even if pulsar hasn't been installed yet.
|
# Making sure you can run this, even if pulsar hasn't been installed yet.
|
||||||
sys.path.insert(0, path.join(path.dirname(__file__), "..", ".."))
|
sys.path.insert(0, path.join(path.dirname(__file__), "..", ".."))
|
||||||
|
@ -12,12 +12,7 @@ from os import path
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
from ..common_testing import TestCaseMixin
|
||||||
# fmt: off
|
|
||||||
# Make the mixin available.
|
|
||||||
sys.path.insert(0, path.join(path.dirname(__file__), ".."))
|
|
||||||
from common_testing import TestCaseMixin # isort:skip # noqa: E402
|
|
||||||
# fmt: on
|
|
||||||
|
|
||||||
|
|
||||||
# Making sure you can run this, even if pulsar hasn't been installed yet.
|
# Making sure you can run this, even if pulsar hasn't been installed yet.
|
||||||
|
@ -9,10 +9,11 @@ import unittest
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
from pytorch3d.common.compat import lstsq
|
from pytorch3d.common.compat import lstsq
|
||||||
from pytorch3d.transforms import acos_linear_extrapolation
|
from pytorch3d.transforms import acos_linear_extrapolation
|
||||||
|
|
||||||
|
from .common_testing import TestCaseMixin
|
||||||
|
|
||||||
|
|
||||||
class TestAcosLinearExtrapolation(TestCaseMixin, unittest.TestCase):
|
class TestAcosLinearExtrapolation(TestCaseMixin, unittest.TestCase):
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
|
@ -8,12 +8,13 @@ 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 import sample_points_from_meshes
|
from pytorch3d.ops import sample_points_from_meshes
|
||||||
from pytorch3d.ops.ball_query import ball_query
|
from pytorch3d.ops.ball_query import ball_query
|
||||||
from pytorch3d.ops.knn import _KNN
|
from pytorch3d.ops.knn import _KNN
|
||||||
from pytorch3d.utils import ico_sphere
|
from pytorch3d.utils import ico_sphere
|
||||||
|
|
||||||
|
from .common_testing import get_random_cuda_device, TestCaseMixin
|
||||||
|
|
||||||
|
|
||||||
class TestBallQuery(TestCaseMixin, unittest.TestCase):
|
class TestBallQuery(TestCaseMixin, unittest.TestCase):
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
from pytorch3d.renderer.blending import (
|
from pytorch3d.renderer.blending import (
|
||||||
BlendParams,
|
BlendParams,
|
||||||
hard_rgb_blend,
|
hard_rgb_blend,
|
||||||
@ -18,6 +17,8 @@ from pytorch3d.renderer.cameras import FoVPerspectiveCameras
|
|||||||
from pytorch3d.renderer.mesh.rasterizer import Fragments
|
from pytorch3d.renderer.mesh.rasterizer import Fragments
|
||||||
from pytorch3d.renderer.splatter_blend import SplatterBlender
|
from pytorch3d.renderer.splatter_blend import SplatterBlender
|
||||||
|
|
||||||
|
from .common_testing import TestCaseMixin
|
||||||
|
|
||||||
|
|
||||||
def sigmoid_blend_naive_loop(colors, fragments, blend_params):
|
def sigmoid_blend_naive_loop(colors, fragments, blend_params):
|
||||||
"""
|
"""
|
||||||
|
@ -12,7 +12,7 @@ import unittest
|
|||||||
import unittest.mock
|
import unittest.mock
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
from common_testing import get_pytorch3d_dir
|
from .common_testing import get_pytorch3d_dir
|
||||||
|
|
||||||
|
|
||||||
# This file groups together tests which look at the code without running it.
|
# This file groups together tests which look at the code without running it.
|
||||||
|
@ -10,7 +10,6 @@ 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 eyes
|
from pytorch3d.ops import eyes
|
||||||
from pytorch3d.renderer.points.pulsar import Renderer as PulsarRenderer
|
from pytorch3d.renderer.points.pulsar import Renderer as PulsarRenderer
|
||||||
from pytorch3d.transforms import so3_exp_map, so3_log_map
|
from pytorch3d.transforms import so3_exp_map, so3_log_map
|
||||||
@ -20,6 +19,8 @@ from pytorch3d.utils import (
|
|||||||
pulsar_from_opencv_projection,
|
pulsar_from_opencv_projection,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from .common_testing import get_tests_dir, TestCaseMixin
|
||||||
|
|
||||||
|
|
||||||
DATA_DIR = get_tests_dir() / "data"
|
DATA_DIR = get_tests_dir() / "data"
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
from pytorch3d.renderer import (
|
from pytorch3d.renderer import (
|
||||||
MeshRasterizer,
|
MeshRasterizer,
|
||||||
NDCMultinomialRaysampler,
|
NDCMultinomialRaysampler,
|
||||||
@ -19,6 +18,8 @@ from pytorch3d.renderer import (
|
|||||||
)
|
)
|
||||||
from pytorch3d.structures import Meshes, Pointclouds
|
from pytorch3d.structures import Meshes, Pointclouds
|
||||||
|
|
||||||
|
from .common_testing import TestCaseMixin
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PyTorch3D renderers operate in an align_corners=False manner.
|
PyTorch3D renderers operate in an align_corners=False manner.
|
||||||
|
@ -8,7 +8,6 @@ import unittest
|
|||||||
from math import radians
|
from math import radians
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
from pytorch3d.renderer.camera_utils import camera_to_eye_at_up, rotate_on_spot
|
from pytorch3d.renderer.camera_utils import camera_to_eye_at_up, rotate_on_spot
|
||||||
from pytorch3d.renderer.cameras import (
|
from pytorch3d.renderer.cameras import (
|
||||||
get_world_to_view_transform,
|
get_world_to_view_transform,
|
||||||
@ -18,6 +17,8 @@ from pytorch3d.renderer.cameras import (
|
|||||||
from pytorch3d.transforms import axis_angle_to_matrix
|
from pytorch3d.transforms import axis_angle_to_matrix
|
||||||
from torch.nn.functional import normalize
|
from torch.nn.functional import normalize
|
||||||
|
|
||||||
|
from .common_testing import TestCaseMixin
|
||||||
|
|
||||||
|
|
||||||
def _batched_dotprod(x: torch.Tensor, y: torch.Tensor):
|
def _batched_dotprod(x: torch.Tensor, y: torch.Tensor):
|
||||||
"""
|
"""
|
||||||
|
@ -36,7 +36,6 @@ import unittest
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
from common_testing import TestCaseMixin
|
|
||||||
from pytorch3d.renderer.camera_utils import join_cameras_as_batch
|
from pytorch3d.renderer.camera_utils import join_cameras_as_batch
|
||||||
from pytorch3d.renderer.cameras import (
|
from pytorch3d.renderer.cameras import (
|
||||||
camera_position_from_spherical_angles,
|
camera_position_from_spherical_angles,
|
||||||
@ -57,6 +56,8 @@ from pytorch3d.transforms import Transform3d
|
|||||||
from pytorch3d.transforms.rotation_conversions import random_rotations
|
from pytorch3d.transforms.rotation_conversions import random_rotations
|
||||||
from pytorch3d.transforms.so3 import so3_exp_map
|
from pytorch3d.transforms.so3 import so3_exp_map
|
||||||
|
|
||||||
|
from .common_testing import TestCaseMixin
|
||||||
|
|
||||||
|
|
||||||
# Naive function adapted from SoftRasterizer for test purposes.
|
# Naive function adapted from SoftRasterizer for test purposes.
|
||||||
def perspective_project_naive(points, fov=60.0):
|
def perspective_project_naive(points, fov=60.0):
|
||||||
|
@ -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 (
|
|||||||
)
|
)
|
||||||
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
|
|||||||
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 @@
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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 @@
|
|||||||
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 @@
|
|||||||
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 @@
|
|||||||
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
|
|||||||
|
|
||||||
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 @@
|
|||||||
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 @@
|
|||||||
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
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
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
|
|||||||
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
|
|||||||
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
|
|||||||
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
|
|||||||
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
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
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 @@
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
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"
|
||||||
|
@ -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 @@
|
|||||||
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 @@
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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 @@
|
|||||||
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 @@
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
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
|
|||||||
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 (
|
|||||||
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
|
|||||||
|
|
||||||
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 (
|
|||||||
)
|
)
|
||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
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
|
|||||||
|
|
||||||
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 (
|
|||||||
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 @@
|
|||||||
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
|
|||||||
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 (
|
|||||||
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
|
|||||||
|
|
||||||
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 (
|
|||||||
)
|
)
|
||||||
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
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user