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
limitations under the License.
"""
import importlib
import argparse
import shutil
import sys
......@@ -171,6 +172,10 @@ def main():
if ov is not None:
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"])
plan = load_pickle(target_dir / "plan.pkl")
gt_dir = preprocessed_output_dir / plan["data_identifier"] / "labelsTr"
......
......@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
import importlib
import argparse
from multiprocessing import Value
import os
import sys
from typing import Any, Mapping, Type, TypeVar
......@@ -209,6 +209,10 @@ def main():
overwrites.append("host.parent_results=${env:det_models}")
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 test_split:
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