Deeplabcut.plot_trajectories

DLC works (CUDA 10, cuDNN 7.4.2, tensorflow-gpu 1.14, Ubuntu 18.04) but I am having an issue after training the network and analyzing the movies to create the ‘plot-poses’ folder when issuing the command:

deeplabcut.plot_trajectories(config_path,[‘full_path/videos/movie_to_use.avi’])

No folders are created and I can’t trace what is causing this since I don’t get any error messages.

strange, are you sure you are setting the [ ]correctly? if the list is not detected correctly it will seem as if nothing happens

Thanks for your reply! Yes, I placed the […] correctly and the paths to the movies as well. Will try some more permutations and see if I move forward.

Hi,

I am having the same issue, everything works perfectly fine except the plot-poses folder is not created.

any luck?

Do you have administrator rights/open the command interface as “run as admin”?

@MWMathis @Yared_215 @TM_Hoogland I’m also having the same issue.I’m using colab to run and analyze the videos.
Did any of you solve the problem?

I’m also having a little bit of a problem with deeplabcut.plot_trajectories()
I added the right path, but I get this error message “No videos found. Make sure you passed a list of videos and that videotype is right.”
I am certain that the video is there because I can see it there. Also, the path to config.yaml is correct too. Any help?

Here is what I ran:

deeplabcut.plot_trajectories(’/home/kt/ws/lm-ws-2020-06-08/config.yaml’, ‘/home/kt/ws/lm-ws-2020-06-08/videos/ADLC_resnet50_lmJun8shuffle1_200000_full.mp4’, videotype=’.mp4’, shuffle=1, trainingsetindex=0, filtered= False , showfigures= False , destfolder= None )

AND

deeplabcut.plot_trajectories(’/home/kt/ws/lm-ws-2020-06-08/config.yaml’, ‘/home/kt/ws/lm-ws-2020-06-08/videos’, videotype=’.mp4’, shuffle=1, trainingsetindex=0, filtered= False , showfigures= False , destfolder= None )

@WSin, what version of DLC are you using?

The latest. Version 2.2b7.

@WSin, you should not be passing a “_full.mp4”, but the original video file rather (as found in video_sets in the config.yaml); otherwise the file is ignored, which may explain why it says that no videos were found.

1 Like

Thank you Jessy. I used the path shown under video_sets_originals in the config.yaml, and it kind of worked.
It no longer gives me the previous error, but now gives me this “No unfiltered data file found in /home/kt/ws/lm-ws-2020-06-08/videos for video A and scorer DLC_resnet50_lmJun8shuffle1_200000.”

Make sure you also specify the argument track_method (either box or skeleton, depending on the one you used when running deeplabcut.convert_detections2tracklets). If you have gone through all stages, you should normally be having either a _bx.h5 or _sk.h5 in the videos folder :slight_smile:

Thank you again.

I conducted the analysis using the GUI. The “specify the tracker method” was set to “box”. The “_bx.h5” does exist.

Here are the list of files in the videos directory:
ADLC_resnet50_lmJun8shuffle1_200000_bx_filtered.h5 ADLC_resnet50_lmJun8shuffle1_200000_full.mp4
ADLC_resnet50_lmJun8shuffle1_200000_sk.pickle
ADLC_resnet50_lmJun8shuffle1_200000_bx.h5 ADLC_resnet50_lmJun8shuffle1_200000_full.pickle
A.mp4
ADLC_resnet50_lmJun8shuffle1_200000_bx.pickle ADLC_resnet50_lmJun8shuffle1_200000_meta.pickle

Awesome @WSin! :smiley:

haha, thanks!

I meant to say that when I got the error, “No unfiltered data file found in /home/kt/ws/lm-ws-2020-06-08/videos for video A and scorer DLC_resnet50_lmJun8shuffle1_200000.”, those things were already in place.

Anything else I could try?

That is very odd… Since you have filtered them already, are you facing the same issue when passing filtered=True?

Yes, unfortunately. I will start again with “skeleton” instead of “box” and see if something changes. Thank you very much Jessy for all your prompt replies.

I ran the whole thing again, and no luck! Error below.

deeplabcut.plot_trajectories('/home/kt/ws/move-ws-2020-07-23/config.yaml', '/home/kt/ws/move-ws-2020-07-23/videos/A.mp4', videotype='.mp4')                                                                                               
Loading  /home/kt/ws/move-ws-2020-07-23/videos/A.mp4 and data.
No unfiltered data file found in /home/kt/ws/move-ws-2020-07-23/videos for video A and scorer DLC_resnet50_moveJul23shuffle1_200000.
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~/anaconda3/envs/dlc-ubuntu/lib/python3.6/site-packages/deeplabcut/utils/plotting.py in plot_trajectories(config, videos, videotype, shuffle, trainingsetindex, filtered, displayedbodyparts, displayedindividuals, showfigures, destfolder, modelprefix, track_method)
    213             df, _, _, suffix = auxiliaryfunctions.load_analyzed_data(
--> 214                 videofolder, vname, DLCscorer, filtered, track_method
    215             )

~/anaconda3/envs/dlc-ubuntu/lib/python3.6/site-packages/deeplabcut/utils/auxiliaryfunctions.py in load_analyzed_data(folder, videoname, scorer, filtered, track_method)
    743     filepath, scorer, suffix = find_analyzed_data(
--> 744         folder, videoname, scorer, filtered, track_method
    745     )

~/anaconda3/envs/dlc-ubuntu/lib/python3.6/site-packages/deeplabcut/utils/auxiliaryfunctions.py in find_analyzed_data(folder, videoname, scorer, filtered, track_method)
    728         msg += "."
--> 729         raise FileNotFoundError(msg)
    730 

FileNotFoundError: No unfiltered data file found in /home/kt/ws/move-ws-2020-07-23/videos for video A and scorer DLC_resnet50_moveJul23shuffle1_200000.

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-2-c448312d4426> in <module>
----> 1 deeplabcut.plot_trajectories('/home/kt/ws/move-ws-2020-07-23/config.yaml', '/home/kt/ws/move-ws-2020-07-23/videos/A.mp4', videotype='.mp4')

~/anaconda3/envs/dlc-ubuntu/lib/python3.6/site-packages/deeplabcut/utils/plotting.py in plot_trajectories(config, videos, videotype, shuffle, trainingsetindex, filtered, displayedbodyparts, displayedindividuals, showfigures, destfolder, modelprefix, track_method)
    238             try:
    239                 _ = auxiliaryfunctions.load_detection_data(
--> 240                     video, DLCscorer, track_method
    241                 )
    242                 print(

~/anaconda3/envs/dlc-ubuntu/lib/python3.6/site-packages/deeplabcut/utils/auxiliaryfunctions.py in load_detection_data(video, scorer, track_method)
    756         tracker = "bx"
    757     else:
--> 758         raise ValueError(f"Unrecognized track_method={track_method}")
    759 
    760     filepath = os.path.splitext(video)[0] + scorer + f"_{tracker}.pickle"

ValueError: Unrecognized track_method=

As mentioned above Deeplabcut.plot_trajectories, you need to pass either ‘box’ or ‘skeleton’ to track_method.

Please refer to my answer above about the track_method.

Concerning how I tried to further investigate this, I used the post below by Mathis.

It appears that my scorer file was not produced correctly (See below --all values are NaN). This is despite no error produced throughout the analysis, and the resulting video (ADLC_resnet50_moveJul23shuffle1_200000_full.mp4) is tracked rather very well.

I can also see the tracking of individual 1 and 2 when I corrected some during the refine tracklets step, so I don’t know why the scorer shows NaNs! Any idea about that?

Not sure that this matters, but JFTR, this project was carried on from several previous version of DLC, as I was upgrading whenever an upgrade was available.

scorer DLC_resnet50_moveJul23shuffle1_200000
individuals individual1 individual2
bodyparts head butt head butt
coords x y likelihood x y likelihood x y likelihood x y likelihood
0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
1 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
3 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
4 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

Thanks!