Allow methods configs to be discovered from external packages. (#1357)

* Allow method_config to be registered from external packages

* Add license

* Add MethodSpecification class + fix linter errors

---------
This commit is contained in:
Jonáš Kulhánek authored and GitHub committed 2023-02-06 13:25:33 -08:00
1 parent bf64769128
commit 59f71eda0e
7 files changed
+183

No files matched your search

+5
View File
@@ -57,6 +57,7 @@ from nerfstudio.models.tensorf import TensoRFModelConfig
from nerfstudio.models.vanilla_nerf import NeRFModel, VanillaModelConfig
from nerfstudio.pipelines.base_pipeline import VanillaPipelineConfig
from nerfstudio.pipelines.dynamic_batch import DynamicBatchPipelineConfig
from nerfstudio.plugins.registry import discover_methods
method_configs: Dict[str, TrainerConfig] = {}
descriptions = {
@@ -387,6 +388,10 @@ method_configs["nerfplayer-ngp"] = TrainerConfig(
vis="viewer",
)
external_methods, external_descriptions = discover_methods()
method_configs.update(external_methods)
descriptions.update(external_descriptions)
AnnotatedBaseConfigUnion = tyro.conf.SuppressFixed[ # Don't show unparseable (fixed) arguments in helptext.
tyro.conf.FlagConversionOff[
tyro.extras.subcommand_type_from_defaults(defaults=method_configs, descriptions=descriptions)