Skip to content

Commit 802eb0a

Browse files
authored
Merge pull request #72 from sidhulyalkar/main
Move Rest of DLC imports into make functions
2 parents bee89bf + 44607f2 commit 802eb0a

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
44
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
55

6-
## [0.2.2] - Unreleased
6+
## [0.2.2] - 2022-01-17
7+
78
+ Fix - improve function to auto generate PoseEstimationTask
89
+ Update - loading DLC results handles multiple DLC output files
10+
+ Update - Adopt lazy import strategy for imported DeepLabCut functions
911

1012
## [0.2.1] - 2022-12-16
1113

element_deeplabcut/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from typing import Optional
1717
from datetime import datetime
1818
from element_interface.utils import find_full_path, find_root_directory
19-
from deeplabcut.utils.auxiliaryfunctions import get_evaluation_folder, GetScorerName
2019
from .readers import dlc_reader
2120

2221
schema = dj.schema()
@@ -375,6 +374,8 @@ def insert_new_model(
375374
prompt (bool): Optional. Prompt the user with all info before inserting.
376375
params (dict): Optional. If dlc_config is path, dict of override items
377376
"""
377+
from deeplabcut.utils.auxiliaryfunctions import GetScorerName # isort:skip
378+
378379
# handle dlc_config being a yaml file
379380
if not isinstance(dlc_config, dict):
380381
dlc_config_fp = find_full_path(get_dlc_root_data_dir(), Path(dlc_config))
@@ -488,6 +489,7 @@ class ModelEvaluation(dj.Computed):
488489

489490
def make(self, key):
490491
from deeplabcut import evaluate_network # isort:skip
492+
from deeplabcut.utils.auxiliaryfunctions import get_evaluation_folder # isort:skip
491493
""".populate() method will launch evaluation for each unique entry in Model."""
492494
dlc_config, project_path, model_prefix, shuffle, trainingsetindex = (
493495
Model & key

element_deeplabcut/train.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@
1212
from element_interface.utils import find_full_path, dict_to_uuid
1313
from .readers import dlc_reader
1414

15-
try:
16-
from deeplabcut.utils.auxiliaryfunctions import get_model_folder
17-
except ImportError:
18-
from deeplabcut.utils.auxiliaryfunctions import (
19-
GetModelFolder as get_model_folder,
20-
)
21-
2215
schema = dj.schema()
2316
_linking_module = None
2417

@@ -249,6 +242,12 @@ class ModelTraining(dj.Computed):
249242

250243
def make(self, key):
251244
from deeplabcut import train_network # isort:skip
245+
try:
246+
from deeplabcut.utils.auxiliaryfunctions import get_model_folder # isort:skip
247+
except ImportError:
248+
from deeplabcut.utils.auxiliaryfunctions import (
249+
GetModelFolder as get_model_folder
250+
) # isort:skip
252251

253252
"""Launch training for each train.TrainingTask training_id via `.populate()`."""
254253
project_path, model_prefix = (TrainingTask & key).fetch1(

element_deeplabcut/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""
22
Package metadata
33
"""
4-
__version__ = "0.2.1"
4+
__version__ = "0.2.2"

0 commit comments

Comments
 (0)