Adding additional data to a trained iteration


I trained DLC and it works great on most of my images. However, there are certain conditions where the labels jump and miss their targets. I would like to augment the dataset to include more labeled data from the types of behavior/body configuration that it is currently struggling to correctly label.

Do I add the paths to the new videos to my config.yaml file and then use deeplabcut.extract_frames?

Thank you,

1 Like


Please see the page detailing the fucntions, which describes how to add new videos:

But also you might want to use the refinement tools to extract frames that are mis-labeled. I.e. you run analysis on the novel videos first, then you can automatically extract outliers and move the labels to the correct location. Please see the documentation and the preprint that details this here:

Also, when you created the project this is the print statement: :wink:

print("\nA new project with name %s is created at %s and a configurable file (config.yaml) is stored there. Change the parameters in this file to adapt to your project’s needs.\n Once you have changed the configuration file, use the function ‘extract_frames’ to select frames for labeling.\n. [OPTIONAL] Use the function ’ add_new_videos ’ to add new videos to your project (at any stage)." %(project_name,str(wd)))


Thank you! I will check it out. :slight_smile:

1 Like

One last thing that wasn’t clear to me. After extracting and labeling frames. When I create a new dataset will it continue from the last checkpoint or will it have to completely retrain? I’m sorry if this is in the documentation and I missed it.

A few more points:

  • deeplabcut.extract_outlier_frames(‘config_path’,[‘videofile_path’]) will also add the video to the config file (so you don’t need to do this first). The only thing you need to do first is analyze the video
  • once you refined all the labels, you do merge and then create a training set and can start training
  • with immediate regard to your question: By default it will start from Image net weights (this is because, perhaps you also added a new body parts and then it would crash). You can, however, change the init_weight manually before you start training by linking it back to the weights from an earlier iteration. That way you can save a few minutes…

Hi Alexander,

I used the trained network to analyse new videos (which were not inside my project), then I extracted the outlier frames. When I did so, a notification appeared saying:

AUTOMATIC ADDING OF VIDEO TO CONFIG FILE FAILED! You need to do this manually for including it in the config.yaml file!

If I don’t add the videos path into the config file, but I refine the outlier labels for such videos and merge them to the dataset, will the network still take these videos as dataset for training a second iteration, or is it mandatory to add them inside the project for it to take them into account for the training?

You should add them to the config file (see GitHub response too: After you merge the datasets, I recommend checking the CollectedData_ … .csv file to be sure all the frames are listed there.