This page contains a list of the essential functions of DeepLabCut as well as demos. There are many optional parameters with each described function, which you can find here. For additional assistance, you can use the help function to better understand what each function does.
We also provide Jupyter notebooks for using DeepLabCut on both a pre-labeled dataset, and on the end user’s own dataset. See all the demo's here!
Open an ipython session and import the package by typing in the terminal:
ipython
import deeplabcut
TIP: for every function there is a associated help document that can be viewed by adding a ? after the function name; i.e. deeplabcut.create_new_project?
. To exit this help screen, type q.
deeplabcut.create_new_project(`Name of the project',`Name of the experimenter', [`Full path of video 1',`Full path of video2',`Full path of video3'], working_directory=`Full path of the working directory',copy_videos=True/False)
- (Note, you can also put
config_path =
in front of the above line to create the path to the config.yaml that is used in the next step, i.e.config_path=deeplabcut.create_project(...)
)
(more details here)
- open the config.yaml file (in a text editor (like atom, gedit, vim etc.)), which can be found in the subfolder created when you set your project name, to change parameters and identify label names!
(more details here)
-
set the config_path:
config_path = '/home/computername/DeepLabCut2.0/yourprojectname/config.yaml'
(for example) -
or you already set it as a variable in step "Create_new_Project" directly above.
mini-demo: create project and edit the yaml file
deeplabcut.extract_frames(`config_path',`automatic/manual',`uniform/kmeans', crop=True/False, checkcropping=True)
(more details here)
deeplabcut.label_frames(`config_path')
(more details here)
mini-demo: using the GUI to label
deeplabcut.check_labels(`config_path')
(more details here)
deeplabcut.create_training_dataset(`config_path',num_shuffles=1)
(more details here)
deeplabcut.train_network(`config_path',shuffle=1)
(more details here)
deeplabcut.evaluate_network(`config_path',shuffle=[1], plotting=True)
(more details here)
deeplabcut.analyze_videos(`config_path',[`/analysis/project/videos/reachingvideo1.avi'], shuffle=1, save_as_csv=True)
deeplabcut.create_labeled_video(`config_path' [`/analysis/project/videos/reachingvideo1.avi',`/analysis/project/videos/reachingvideo2.avi'])
deeplabcut.plot_trajectories(`config_path',[`/analysis/project/videos/reachingvideo1.avi'])
(more details here)
deeplabcut.extract_outlier_frames(`config_path',[`videofile_path'])
(more details here)
(refinement and augmentation of the training dataset)
deeplabcut.refine_labels(`config_path')
mini-demo: using the refinement GUI, a user can load the file then zoom, pan, and edit and/or remove points:
When done editing the labels, merge:
deeplabcut.merge_datasets(`config_path')
(more details here)
In ipython/Jupyter notebook:
deeplabcut.nameofthefunction?
In Python:
help(deeplabcut.nameofthefunction)
Return to readme.