Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yaoyuping
nnDetection
Commits
b5df69f9
Commit
b5df69f9
authored
Jun 18, 2021
by
mibaumgartner
Browse files
add dynamic imports
parent
1c7d9df3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
scripts/consolidate.py
scripts/consolidate.py
+5
-0
scripts/predict.py
scripts/predict.py
+5
-1
No files found.
scripts/consolidate.py
View file @
b5df69f9
...
...
@@ -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"
...
...
scripts/predict.py
View file @
b5df69f9
...
...
@@ -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."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment