mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-01-17 03:40:34 +08:00
Extract finding directories for test data
Summary: Make common functions for finding directories where test data is found, instead of lots of tests using their own `__file__` while trying to get ./tests/data and the tutorials data. Reviewed By: nikhilaravi Differential Revision: D27633701 fbshipit-source-id: 1467bb6018cea16eba3cab097d713116d51071e9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
24ee279005
commit
1216b5765a
@@ -9,12 +9,11 @@ See pytorch3d/renderer/mesh/clip.py for more details about the
|
||||
clipping process.
|
||||
"""
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
import imageio
|
||||
import numpy as np
|
||||
import torch
|
||||
from common_testing import TestCaseMixin, load_rgb_image
|
||||
from common_testing import TestCaseMixin, load_rgb_image, get_tests_dir
|
||||
from pytorch3d.io import save_obj
|
||||
from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_transform
|
||||
from pytorch3d.renderer.lighting import PointLights
|
||||
@@ -34,7 +33,7 @@ from pytorch3d.structures.meshes import Meshes
|
||||
# If DEBUG=True, save out images generated in the tests for debugging.
|
||||
# All saved images have prefix DEBUG_
|
||||
DEBUG = False
|
||||
DATA_DIR = Path(__file__).resolve().parent / "data"
|
||||
DATA_DIR = get_tests_dir() / "data"
|
||||
|
||||
|
||||
class TestRenderMeshesClipping(TestCaseMixin, unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user