Args: trainFraction: the training fraction (as defined in the project configuration) for which to get the model folder shuffle: the index of the shuffle for which to get the model folder cfg: the project configuration modelprefix: The name of the fold
(
trainFraction: float,
shuffle: int,
cfg: dict,
modelprefix: str = "",
engine: Engine = Engine.TF,
)
| 534 | |
| 535 | |
| 536 | def get_model_folder( |
| 537 | trainFraction: float, |
| 538 | shuffle: int, |
| 539 | cfg: dict, |
| 540 | modelprefix: str = "", |
| 541 | engine: Engine = Engine.TF, |
| 542 | ) -> Path: |
| 543 | """ |
| 544 | Args: |
| 545 | trainFraction: the training fraction (as defined in the project configuration) |
| 546 | for which to get the model folder |
| 547 | shuffle: the index of the shuffle for which to get the model folder |
| 548 | cfg: the project configuration |
| 549 | modelprefix: The name of the folder |
| 550 | engine: The engine for which we want the model folder. Defaults to `tensorflow` |
| 551 | for backwards compatibility with DeepLabCut 2.X |
| 552 | |
| 553 | Returns: |
| 554 | the relative path from the project root to the folder containing the model files |
| 555 | for a shuffle (configuration files, snapshots, training logs, ...) |
| 556 | """ |
| 557 | proj_id = f"{cfg['Task']}{cfg['date']}" |
| 558 | return Path( |
| 559 | modelprefix, |
| 560 | engine.model_folder_name, |
| 561 | f"iteration-{cfg['iteration']}", |
| 562 | f"{proj_id}-trainset{int(trainFraction * 100)}shuffle{shuffle}", |
| 563 | ) |
| 564 | |
| 565 | |
| 566 | def get_evaluation_folder( |