"tests/vscode:/vscode.git/clone" did not exist on "c46deb0576edaff5cd5a7d384c617478c7a73a70"
test_data_source.py 895 Bytes
Newer Older
Jeremy Reizenstein's avatar
Jeremy Reizenstein committed
1
2
3
4
5
6
7
8
9
10
11
# 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 unittest

from omegaconf import OmegaConf
from pytorch3d.implicitron.dataset.data_source import ImplicitronDataSource
from pytorch3d.implicitron.tools.config import get_default_args
Jeremy Reizenstein's avatar
Jeremy Reizenstein committed
12
from tests.common_testing import get_tests_dir
Jeremy Reizenstein's avatar
Jeremy Reizenstein committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

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())