diff --git a/CHANGELOG.md b/CHANGELOG.md index e3ac610..a0aa703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,15 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention. -## [0.2.7] - 2023-08-04 +## [0.2.8] - 2023-08-07 + Update - GitHub Actions with new reusable workflows + Update - Readme instructions +## [0.2.7] - 2023-08-04 + ++ Fix - Update the project path in the pose config file to train the model + ## [0.2.6] - 2023-05-22 + Add - DeepLabCut, NWB, and DANDI citations @@ -73,6 +77,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and graciously provided by the Mathis Lab. + Add - Support for 2d single-animal models +[0.2.8]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.8 [0.2.7]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.7 [0.2.6]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.6 [0.2.5]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.5 diff --git a/element_deeplabcut/train.py b/element_deeplabcut/train.py index 89d1047..cfb8f0b 100644 --- a/element_deeplabcut/train.py +++ b/element_deeplabcut/train.py @@ -246,6 +246,7 @@ def make(self, key): try: from deeplabcut.utils.auxiliaryfunctions import ( get_model_folder, + edit_config, ) # isort:skip except ImportError: from deeplabcut.utils.auxiliaryfunctions import ( @@ -278,6 +279,20 @@ def make(self, key): # Write dlc config file to base project folder dlc_cfg_filepath = dlc_reader.save_yaml(project_path, dlc_config) + # ---- Update the project path in the DLC pose configuration (yaml) files ---- + model_folder = get_model_folder( + trainFraction=dlc_config["train_fraction"], + shuffle=dlc_config["shuffle"], + cfg=dlc_config, + modelprefix=dlc_config["modelprefix"], + ) + model_train_folder = project_path / model_folder / "train" + + edit_config( + model_train_folder / "pose_cfg.yaml", + {"project_path": project_path.as_posix()}, + ) + # ---- Trigger DLC model training job ---- train_network_input_args = list(inspect.signature(train_network).parameters) train_network_kwargs = { @@ -293,18 +308,7 @@ def make(self, key): except KeyboardInterrupt: # Instructions indicate to train until interrupt print("DLC training stopped via Keyboard Interrupt") - snapshots = list( - ( - project_path - / get_model_folder( - trainFraction=dlc_config["train_fraction"], - shuffle=dlc_config["shuffle"], - cfg=dlc_config, - modelprefix=dlc_config["modelprefix"], - ) - / "train" - ).glob("*index*") - ) + snapshots = list(model_train_folder.glob("*index*")) max_modified_time = 0 # DLC goes by snapshot magnitude when judging 'latest' for evaluation # Here, we mean most recently generated