mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-22 23:30:35 +08:00
test runner for eval_demo
Summary: Create a test runner for the eval_demo code. Debugging this is useful for understanding datasets. Introduces an environment variable INTERACTIVE_TESTING for ignoring tests which are not intended for use in regular test runs. Reviewed By: shapovalov Differential Revision: D35964016 fbshipit-source-id: ab0f93aff66b6cfeca942b14466cf81f7feb2224
This commit is contained in:
committed by
Facebook GitHub Bot
parent
44cb00e468
commit
ec9580a1d4
39
tests/implicitron/test_eval_demo.py
Normal file
39
tests/implicitron/test_eval_demo.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from pytorch3d.implicitron import eval_demo
|
||||
|
||||
|
||||
if os.environ.get("FB_TEST", False):
|
||||
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.
|
||||
It only runs interactively.
|
||||
"""
|
||||
|
||||
|
||||
class TestEvalDemo(unittest.TestCase):
|
||||
def test_a(self):
|
||||
if not interactive_testing_requested():
|
||||
return
|
||||
|
||||
os.environ["CO3D_DATASET_ROOT"] = CO3D_MANIFOLD_PATH
|
||||
path_manager = get_path_manager(silence_logs=True)
|
||||
|
||||
eval_demo.evaluate_dbir_for_category(
|
||||
"donut", single_sequence_id=0, path_manager=path_manager
|
||||
)
|
||||
Reference in New Issue
Block a user