Commit b5df69f9 authored by mibaumgartner's avatar mibaumgartner
Browse files

add dynamic imports

parent 1c7d9df3
...@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
""" """
import importlib
import argparse import argparse
import shutil import shutil
import sys import sys
...@@ -171,6 +172,10 @@ def main(): ...@@ -171,6 +172,10 @@ def main():
if ov is not None: if ov is not None:
cfg.merge_with_dotlist(ov) cfg.merge_with_dotlist(ov)
for imp in cfg.get("additional_imports", []):
print(f"Additional import found {imp}")
importlib.import_module(imp)
preprocessed_output_dir = Path(cfg["host"]["preprocessed_output_dir"]) preprocessed_output_dir = Path(cfg["host"]["preprocessed_output_dir"])
plan = load_pickle(target_dir / "plan.pkl") plan = load_pickle(target_dir / "plan.pkl")
gt_dir = preprocessed_output_dir / plan["data_identifier"] / "labelsTr" gt_dir = preprocessed_output_dir / plan["data_identifier"] / "labelsTr"
......
...@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and ...@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
""" """
import importlib
import argparse import argparse
from multiprocessing import Value
import os import os
import sys import sys
from typing import Any, Mapping, Type, TypeVar from typing import Any, Mapping, Type, TypeVar
...@@ -209,6 +209,10 @@ def main(): ...@@ -209,6 +209,10 @@ def main():
overwrites.append("host.parent_results=${env:det_models}") overwrites.append("host.parent_results=${env:det_models}")
cfg.merge_with_dotlist(overwrites) cfg.merge_with_dotlist(overwrites)
for imp in cfg.get("additional_imports", []):
print(f"Additional import found {imp}")
importlib.import_module(imp)
if check: if check:
if test_split: if test_split:
raise ValueError("Check is not supported for test split option.") raise ValueError("Check is not supported for test split option.")
......
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