Visitar URL original
DeepLabCut 3.0 - Updates to COLABs and Notebooks for the PyTorch Engine by n-poulsen · Pull Request #2868 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions deeplabcut/create_project/demo_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
from pathlib import Path

import deeplabcut
from deeplabcut.core.engine import Engine
from deeplabcut.utils import auxiliaryfunctions


def load_demo_data(config, createtrainingset=True):
def load_demo_data(
config: str,
createtrainingset: bool = True,
engine: Engine = Engine.PYTORCH,
):
"""
Loads the demo data -- subset from trail-tracking data in Mathis et al. 2018.
When loading, it sets paths correctly to run this project on your system
Expand All @@ -29,6 +34,9 @@ def load_demo_data(config, createtrainingset=True):
createtrainingset : bool
Boolean variable indicating if a training set shall be created.

engine: Engine
The Engine to create the training set for if a training set shall be created.

Example
--------
>>> deeplabcut.load_demo_data('config.yaml')
Expand All @@ -40,7 +48,7 @@ def load_demo_data(config, createtrainingset=True):
transform_data(config)
if createtrainingset:
print("Loaded, now creating training data...")
deeplabcut.create_training_dataset(config, num_shuffles=1)
deeplabcut.create_training_dataset(config, num_shuffles=1, engine=engine)


def transform_data(config):
Expand Down
2 changes: 1 addition & 1 deletion deeplabcut/pose_estimation_pytorch/config/base/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runner:
save_epochs: 25
save_optimizer_state: false
train_settings:
batch_size: 1
batch_size: 8
dataloader_workers: 0
dataloader_pin_memory: false
display_iters: 500
Expand Down
6 changes: 5 additions & 1 deletion examples/COLAB/COLAB_3miceDemo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@
"id": "TGChzLdc-lUJ"
},
"source": [
"# DeepLabCut 2.2 Toolbox Demo on 3 mice data\n",
"# DeepLabCut 2.2+ Toolbox Demo on 3 mice data\n",
"![alt text](https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/1628250004229-KVYD7JJVHYEFDJ32L9VJ/DLClogo2021.jpg?format=1000w)\n",
"\n",
"https://github.com/DeepLabCut/DeepLabCut\n",
"\n",
"Note: this Colab notebook was written to accompany the Nature Methods publication [_Multi-animal pose estimation, identification and tracking with DeepLabCut_](https://www.nature.com/articles/s41592-022-01443-0) with the TensorFlow engine. To learn about DeepLabCut 3.0+ and the PyTorch engine, you can check out our other notebooks (such as [`COLAB_YOURDATA_maDLC_TrainNetwork_VideoAnalysis.ipynb`](https://github.com/DeepLabCut/DeepLabCut/blob/main/examples/COLAB/COLAB_YOURDATA_maDLC_TrainNetwork_VideoAnalysis.ipynb)).\n",
"\n",
"### This notebook illustrates how to use COLAB for a multi-animal DeepLabCut (maDLC) Demo 3 mouse project:\n",
"\n",
"- load our mini-demo data that includes a pretrained model and unlabeled video.\n",
"- analyze a novel video.\n",
"- assemble animals and tracklets.\n",
"- create quality check plots and video.\n",
"\n",
"### To create a full maDLC pipeline please see our full docs: https://deeplabcut.github.io/DeepLabCut/README.html\n",
"\n",
"- Of interest is a full how-to for maDLC: https://deeplabcut.github.io/DeepLabCut/docs/maDLC_UserGuide.html\n",
"- a quick guide to maDLC: https://deeplabcut.github.io/DeepLabCut/docs/tutorial.html\n",
"- a demo COLAB for how to use maDLC on your own data: https://github.com/DeepLabCut/DeepLabCut/blob/main/examples/COLAB/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb\n",
Expand Down
Loading