Problems with create_labeled_video() in Windows

hi there,

I am using dlc 2.0 on Windows 10 (GPU). After successfully training and evaluating the network (in mydir there are the h5 and the pickle files) with my labeled frames and wanting to create a labeled video, when I run:


path_config_file = ‘D:\mydir\config.yaml’
videofile_path = ‘D:\mydir\videos\myvideo.mp4’

Nothing happens. I debugged a bit and see that in, the function getlistofvideos returns an empty list. I also tried to pass a directory and videotype=‘mp4’ but no luck (still an empty list).

Before I start modifying things, I guess this because I am not following a convention related to how to pass Windows paths. Am I missing something?

Many thanks!

1 Like

I was having similar issues with the video pathing when analyzing and creating labeled videos. I would recommend:
deeplabcut.create_labeled_video(path_config_file, [r’D:/mydir/videos/myvideo.mp4’])

I would recommend copying the path directly from your files explorer using shift+right click to copy the path instead of using the videofile_path.

1 Like

Hi Kyle_Kelly,
Thanks for the suggestion. Yes, I tried both r’/’ and ‘\’ and no luck.

I will try to modify the getlistofvideos function and report back.

it would need to be: videofile_path = ‘D:\\mydir\\videos\\myvideo.mp4’

also, I assume you ran analyze_video first, and you see the .h5 file? in the same folder as the video?

also, check out the Troubleshooting tips here:

Yes, I also tried'D:\\mydir\\videos\\myvideo.mp4' and I did run analyze_video (the h5 and pickle files are there).

OK, found the problem. The argument of the create_labeled_video should be ['D:\\mydir\\videos\\myvideo.mp4']

I found out about this by reading the specs in the function description. I knew it was a silly syntactic problem :sweat:

1 Like