import deeplabcut import os configpath = os.path.join( '/home/neudata/Desktop/DeepLabCut/examples/openfield-Pranav-2018-10-30/config.yaml' ) deeplabcut.load_demo_data(configpath) deeplabcut.train_network(configpath, maxiters=5) #trains for 5 iterations #manually test GUI... deeplabcut.label_frames(configpath)
import os from pathlib import Path os.environ["DLClight"] = "True" import deeplabcut import numpy as np # Loading example data set path_config_file = os.path.join(os.getcwd(), "openfield-Pranav-2018-10-30/config.yaml") cfg = deeplabcut.auxiliaryfunctions.read_config(path_config_file) maxiters = 10000 deeplabcut.load_demo_data(path_config_file) ## Create one split and make Shuffle 2 and 3 have the same split. ###Note that the new function in DLC 2.1 simplifies network/augmentation comparisons greatly: deeplabcut.create_training_model_comparison( path_config_file, num_shuffles=1, net_types=["resnet_50", "efficientnet-b3"], augmenter_types=["imgaug", "scalecrop", "tensorpack"], ) ## here is an "old way" to do this """ trainIndices, testIndices=deeplabcut.mergeandsplit(path_config_file,trainindex=0,uniform=True) deeplabcut.create_training_dataset(path_config_file,Shuffles=[2],trainIndices=trainIndices,testIndices=testIndices) deeplabcut.create_training_dataset(path_config_file,Shuffles=[3],trainIndices=trainIndices,testIndices=testIndices)
import os os.environ["CUDA_VISIBLE_DEVICES"] = str(0) import deeplabcut import numpy as np # Loading example data set path_config_file = os.path.join(os.getcwd(), "openfield-Pranav-2018-10-30/config.yaml") cfg = deeplabcut.auxiliaryfunctions.read_config(path_config_file) maxiters = 50000 saveiters = 10000 displayiters = 500 deeplabcut.load_demo_data(path_config_file, createtrainingset=False) ## Create one identical splits for 3 networks and 3 augmentations ###Note that the new function in DLC 2.1 simplifies network/augmentation comparisons greatly: Shuffles = deeplabcut.create_training_model_comparison( path_config_file, num_shuffles=1, net_types=["mobilenet_v2_0.35", "resnet_50", "efficientnet-b3"], augmenter_types=["imgaug", "scalecrop", "tensorpack"], ) for idx, shuffle in enumerate(Shuffles): posefile, _, _ = deeplabcut.return_train_network_path( path_config_file, shuffle=shuffle )