Commit e5fece78 authored by Yanghan Wang's avatar Yanghan Wang Committed by Facebook GitHub Bot
Browse files

register all builtin dataset mappers

Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/394

Reviewed By: wrlife

Differential Revision: D40533013

fbshipit-source-id: c4c0b08b8afb0c5c622a945bd2ef9c3e682f3039
parent 4b91c947
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# @fb-only: from . import fb # isort:skip # noqa
from .build import build_dataset_mapper, D2GO_DATA_MAPPER_REGISTRY # noqa from .build import build_dataset_mapper, D2GO_DATA_MAPPER_REGISTRY # noqa
from .d2go_dataset_mapper import D2GoDatasetMapper # noqa from .d2go_dataset_mapper import D2GoDatasetMapper # noqa
from .rotated_dataset_mapper import RotatedDatasetMapper # noqa from .rotated_dataset_mapper import RotatedDatasetMapper # noqa
...@@ -53,15 +53,24 @@ class BaseRegistryPopulationTests(object): ...@@ -53,15 +53,24 @@ class BaseRegistryPopulationTests(object):
class TestMetaArchRegistryPopulation(unittest.TestCase, BaseRegistryPopulationTests): class TestMetaArchRegistryPopulation(unittest.TestCase, BaseRegistryPopulationTests):
def setUp(self): def get_registered_items(self):
from d2go.registry.builtin import META_ARCH_REGISTRY
return [k for k, v in META_ARCH_REGISTRY]
def import_all_modules(self):
import d2go.modeling import d2go.modeling
self._package = d2go.modeling import_submodules(d2go.modeling)
class TestDataMapperRegistryPopulation(unittest.TestCase, BaseRegistryPopulationTests):
def get_registered_items(self): def get_registered_items(self):
from d2go.registry.builtin import META_ARCH_REGISTRY from d2go.data.dataset_mappers import D2GO_DATA_MAPPER_REGISTRY
return [k for k, v in META_ARCH_REGISTRY] return [k for k, v in D2GO_DATA_MAPPER_REGISTRY]
def import_all_modules(self): def import_all_modules(self):
import_submodules(self._package) import d2go.data.dataset_mappers
import_submodules(d2go.data.dataset_mappers)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment