mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-22 23:30:35 +08:00
dataset_map_provider
Summary: replace dataset_zoo with a pluggable DatasetMapProvider. The logic is now in annotated_file_dataset_map_provider. Reviewed By: shapovalov Differential Revision: D36443965 fbshipit-source-id: 9087649802810055e150b2fbfcc3c197a761f28a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
69c6d06ed8
commit
79c61a2d86
32
tests/implicitron/test_data_source.py
Normal file
32
tests/implicitron/test_data_source.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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 omegaconf import OmegaConf
|
||||
from pytorch3d.implicitron.dataset.data_source import ImplicitronDataSource
|
||||
from pytorch3d.implicitron.tools.config import get_default_args
|
||||
|
||||
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"
|
||||
DEBUG: bool = False
|
||||
|
||||
|
||||
class TestDataSource(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.maxDiff = None
|
||||
|
||||
def test_one(self):
|
||||
cfg = get_default_args(ImplicitronDataSource)
|
||||
yaml = OmegaConf.to_yaml(cfg, sort_keys=False)
|
||||
if DEBUG:
|
||||
(DATA_DIR / "data_source.yaml").write_text(yaml)
|
||||
self.assertEqual(yaml, (DATA_DIR / "data_source.yaml").read_text())
|
||||
Reference in New Issue
Block a user