How to extract data and make stuff from network

Trying to generate cool maps like those in https://github.com/DeepLabCut/DeepLabCut/blob/52080cda5f7ea8e92fa43d8cf5cb2e6e9a42ca07/docs/functionDetails.md
But I cant get anything to work! How do I do this?
I tried the command below:
deeplabcut.utils.plotting.plot_trajectories(D:\Anaconda\DeepLabCut\DeeplabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\config, D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\videos\M1120005_1523_pr_070815_W2_s.mp4, videotype=’.mp4’, shuffle=1, trainingsetindex=0, filtered=False, displayedbodyparts=‘all’, displayedindividuals=‘all’, showfigures=False, destfolder=None, modelprefix=’’, track_method=‘skeleton’)

But it gave me syntax errors. I see nothing in the GUI that helps make these actual datapoints.


This is what happens when I do the analyze videos. It doesnt plot anything!!! but I can still ccreate labelled videos. what is wrong?

Hey! If you pay attention to the documentation of the function as well as the GitHub link you posted, you’ll notice that the function awaits a list of video paths rather than a single string. Let me know if
[D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\videos\M1120005_1523_pr_070815_W2_s.mp4, videotype=’.mp4’] works.

[quote=“jeylau, post:3, topic:44603”]
[D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\videos\M1120005_1523_pr_070815_W2_s.mp4, videotype=’.mp4’]
[/quote]**


I did that, but I am still missing something I am afraid. Is there any chance you can see whats wrong from this? Thank you so much for helping me!

deeplabcut.utils.plotting.plot_trajectories(D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\config,[D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\videos\M1120005_1523_pr_070815_W2_s.mp4, videotype=’.mp4’], shuffle=1, trainingsetindex=0, filtered=False, displayedbodyparts=‘all’, displayedindividuals=‘all’, showfigures=False, destfolder=None, modelprefix=’’, track_method=‘skeleton’)
This is my code.

do you think it could be something with me not having a destfolder or the fact that I dont have amodel prefix? I dont really know what to put in those.

@jeylau
Do you have any other ideas sir? Still have not figured out my errors.

Looks like a typo with placement of the closing bracket (after the video string, not after videotype) and you need some raw string for the paths on windows. Try:

deeplabcut.utils.plotting.plot_trajectories(r"D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\config.yaml",[r"D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\videos\M1120005_1523_pr_070815_W2_s.mp4"], videotype=’.mp4’, shuffle=1, trainingsetindex=0, filtered=False, displayedbodyparts=‘all’, displayedindividuals=‘all’, showfigures=False, destfolder=None, modelprefix=’’, track_method=‘skeleton’)
1 Like


@backyardbiomech
Hmm… This looks like a step in the right direction but I must have some invalid character somewhere. Any ideas? I greatly appreciate the help.

It’s hard to tell from the screenshot, but it looks like there may be a space before .mp4 inside the single quote, and a space between the single quotes for model prefix. Try eliminating those spaces.

Hm… there arent such spaces.
deeplabcut.utils.plotting.plot_trajectories(r"D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\config.yaml",[r"D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\videos\M1120005_1523_pr_070815_W2_s.mp4"], videotype=’.mp4’, shuffle=1, trainingsetindex=0, filtered=False, displayedbodyparts=‘all’, displayedindividuals=‘all’, showfigures=False, destfolder=None, modelprefix=’’, track_method=‘skeleton’)

@Murray_Marx, the modelprefix looks wrong, the quotation marks around “mp4” too. Note that these are optional parameters, so unless you actually want to pass something specific, it is just better (safer) to ignore these arguments and leave them at their default values.
Your command would be much simpler:
deeplabcut.utils.plotting.plot_trajectories(r"D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\config.yaml",[r"D:\Anaconda\DeepLabCut\DeepLabCut\conda-environments\MONKEYHANDS-MURRAYMARX-2020-10-06\videos\M1120005_1523_pr_070815_W2_s.mp4"], videotype=".mp4", track_method='skeleton')

As the error says, you have an invalid character that python doesn’t recognize. That could be due to your selected keyboard layout, or from copying/pasting. I would retype the whole thing rather than copying/pasting, being sure to use proper quotation marks.

@backyardbiomech @jeylau
That fixed the error! Unfortunately I seem to be getting another:


This is telling me that I do not have an h5 file for that video and that I havent anaylzed and the stuff isnt in that folder.
However, I assure that this is not the case! I have analyzed that video, in that folder, and I even created a labeled video earlier for it. What could be happening here? I really appreciate your help!

this is incorrect. The function you want is: deeplabcut.plot_trajectories You can look up how to format with: deeplabcut.plot_trajectories?

Thank you! This worked!
Are there any other functions with which I can create plots?