Skip to content

Commit 8ca047d

Browse files
committed
Merge 'main' of datajoint/element-deeplabcut
2 parents b16c386 + 78ac980 commit 8ca047d

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
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.7] - 2023-08-04
6+
## [0.2.8] - 2023-08-07
77

88
+ Update - GitHub Actions with new reusable workflows
99
+ Update - Readme instructions
1010

11+
## [0.2.7] - 2023-08-04
12+
13+
+ Fix - Update the project path in the pose config file to train the model
14+
1115
## [0.2.6] - 2023-05-22
1216

1317
+ Add - DeepLabCut, NWB, and DANDI citations
@@ -73,6 +77,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
7377
graciously provided by the Mathis Lab.
7478
+ Add - Support for 2d single-animal models
7579

80+
[0.2.8]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.8
7681
[0.2.7]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.7
7782
[0.2.6]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.6
7883
[0.2.5]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.5

element_deeplabcut/train.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ def make(self, key):
246246
try:
247247
from deeplabcut.utils.auxiliaryfunctions import (
248248
get_model_folder,
249+
edit_config,
249250
) # isort:skip
250251
except ImportError:
251252
from deeplabcut.utils.auxiliaryfunctions import (
@@ -278,6 +279,20 @@ def make(self, key):
278279
# Write dlc config file to base project folder
279280
dlc_cfg_filepath = dlc_reader.save_yaml(project_path, dlc_config)
280281

282+
# ---- Update the project path in the DLC pose configuration (yaml) files ----
283+
model_folder = get_model_folder(
284+
trainFraction=dlc_config["train_fraction"],
285+
shuffle=dlc_config["shuffle"],
286+
cfg=dlc_config,
287+
modelprefix=dlc_config["modelprefix"],
288+
)
289+
model_train_folder = project_path / model_folder / "train"
290+
291+
edit_config(
292+
model_train_folder / "pose_cfg.yaml",
293+
{"project_path": project_path.as_posix()},
294+
)
295+
281296
# ---- Trigger DLC model training job ----
282297
train_network_input_args = list(inspect.signature(train_network).parameters)
283298
train_network_kwargs = {
@@ -293,18 +308,7 @@ def make(self, key):
293308
except KeyboardInterrupt: # Instructions indicate to train until interrupt
294309
print("DLC training stopped via Keyboard Interrupt")
295310

296-
snapshots = list(
297-
(
298-
project_path
299-
/ get_model_folder(
300-
trainFraction=dlc_config["train_fraction"],
301-
shuffle=dlc_config["shuffle"],
302-
cfg=dlc_config,
303-
modelprefix=dlc_config["modelprefix"],
304-
)
305-
/ "train"
306-
).glob("*index*")
307-
)
311+
snapshots = list(model_train_folder.glob("*index*"))
308312
max_modified_time = 0
309313
# DLC goes by snapshot magnitude when judging 'latest' for evaluation
310314
# Here, we mean most recently generated

0 commit comments

Comments
 (0)