Extract Outlier Frames (GUI) unable to find analysed video

Hi, I’m having issues using extract outlier frames in the DLC Gui (single animal). When selecting my videos and pressing okay, I get the following error:

No unfiltered data file found in D:\DLC\SPR-SideView-Alex-2021-01-25\videos for video AR7-13-10-20-A1-1 and scorer DLC_resnet_50_SPR-SideViewJan25shuffle1_300000.
It seems the video has not been analyzed yet, or the video is not found! You can only refine the labels after the a video is analyzed. Please run ‘analyze_video’ first. Or, please double check your video file path

I have tried updating my version of deeplabcut and ffmpeg and have checked that my path is correct and that the videos selected have been analysed. Any help would be really appreciated!

Does your network training have iterations? Because I have also encountered this problem, I found that I need to re-analyze the video every time I perform an iteration and extract outlier frames.

Hi,

first of all confirm that the .h5 files resulting from the analysis are or are not present in the path with videos you analyzed. Were there any errors present during video analysis? And could you provide the whole traceback? It’s hard to say based of off only the error message

Thanks for your reply. Yes, the .h5 files are in the path with the videos and no, I didn’t get any errors during the process. It may be worth noting, however, that while I do most steps on a local machine, I run the training/ labelling steps on my institutions supercomputer. Perhaps an error has occurred during the file transfer between my local machine? I have previously run DLC successfully this way multiple times however.
Also, as I’m using the GUI, I’m not sure I have the entire traceback, in the way I would have had in previous DLC versions. I simply load the config file, select a video to extract outlier frames from and press okay, before getting the error message- sorry for not being much help.

Thank you for your reply. I believe I only have the one iteration (iteration-0) so I’m not sure this would apply- I can try re-analysing the videos however.

Traceback is still printed in the terminal even if you run DLC from GUI. Can you try to run the function and provide screenshot of it? Also, can you load the .h5 file and check if there is tracking data inside? This is a long shot, since error points to wrong path, but let’s check everything that might be important.

You can use jupyter notebook and just:

import pandas as pd
df = pd.read_hdf(path_to_.h5_file)
df

Based on this:

You should have a file with the exact path and name:
D:\DLC\SPR-SideView-Alex-2021-01-25\videos\AR7-13-10-20-A1-1DLC_resnet_50_SPR-SideViewJan25shuffle1_300000.h5

If that exact name or path doesn’t exist (make sure hyphens underscores etc all match exactly), that’s the easiest explanation. Possibly something in the name or path changed when transferring files?

The other possibility is the file is corrupted or doesn’t contain data, but I would expect a different error. To see if there is a more informative traceback, call the command from the command line:

conda activate DLC (or whatever your env is)
ipython
import deeplabcut as dlc
config=r"path\to\config.yaml"
vids=[r"path\to\video.mp4", r"path\to\othervideoIfDesired.mp4"]
dlc.extract_outlier_frames(config, vids)

That might provide a more helpful traceback. There are also a number of settings you can change in that call (see the code here).

Thank you so much for your help! I did check the path and file name and whilst the path was correct, I didn’t have a file named AR7-13-10-20-A1-1DLC_resnet_50_SPR-SideViewJan25shuffle1_300000.h5, instead, it was named AR7-13-10-20-A1-2DeepCut_resnet50_SPR-SideViewJan25shuffle1_300000.h5

This may seem like a really stupid question, but do you know why the file name is incorrect? I’ve never had this problem before. I manually changed the filename to what you wrote above and got slightly further, before running into the following error:

(DLC-GPU) D:>ipython
Python 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)]
Type ‘copyright’, ‘credits’ or ‘license’ for more information
IPython 7.19.0 – An enhanced Interactive Python. Type ‘?’ for help.

In [1]: import deeplabcut

In [2]: config= r’D:\DLC\SPR-SideView-Alex-2021-01-25\config.yaml’

In [3]: vids=[r’D:\DLC\SPR-SideView-Alex-2021-01-25\videos\AR7-13-10-20-A1-1.avi’]

In [4]: deeplabcut.extract_outlier_frames(config,vids)
Method jump found 16170 putative outlier frames.
Do you want to proceed with extracting 20 of those?
If this list is very large, perhaps consider changing the parameters (start, stop, p_bound, comparisonbodyparts) or use a different method.
yes/noyes
Frames from video AR7-13-10-20-A1-1 already extracted (more will be added)!
Loading video…
Duration of video [s]: 134.6 , recorded @ 200.0 fps!
Overall # of frames: 26920 with (cropped) frame dimensions:
Kmeans-quantization based extracting of frames from 0.0 seconds to 134.6 seconds.
Extracting and downsampling… 16170 frames from the video.
905it [00:14, 64.46it/s][dvvideo @ 000001f9e44235c0] could not find dv frame profile
[dvvideo @ 000001f9e4421540] could not find dv frame profile
[dvvideo @ 000001f9e4420f80] could not find dv frame profile
[dvvideo @ 000001f9e4420780] could not find dv frame profile
[dvvideo @ 000001f9e441ff40] could not find dv frame profile
912it [00:14, 65.97it/s][dvvideo @ 000001f9e44235c0] could not find dv frame profile
[dvvideo @ 000001f9e4422d80] could not find dv frame profile
[dvvideo @ 000001f9e4422580] could not find dv frame profile
[dvvideo @ 000001f9e4421d40] could not find dv frame profile
[dvvideo @ 000001f9e4421540] could not find dv frame profile
[dvvideo @ 000001f9e4420f80] could not find dv frame profile
[dvvideo @ 000001f9e4420780] could not find dv frame profile
919it [00:14, 67.08it/s][dvvideo @ 000001f9e441ff40] could not find dv frame profile
[dvvideo @ 000001f9e4422d80] could not find dv frame profile
[dvvideo @ 000001f9e4422580] could not find dv frame profile
[dvvideo @ 000001f9e4421d40] could not find dv frame profile
[dvvideo @ 000001f9e4421540] could not find dv frame profile
[dvvideo @ 000001f9e4420f80] could not find dv frame profile
[dvvideo @ 000001f9e4420780] could not find dv frame profile
[dvvideo @ 000001f9e441ff40] could not find dv frame profile
[dvvideo @ 000001f9e441ff40] could not find dv frame profile

I’m assuming this is because the naming issue runs deeper than simply the name of the .h5 file?

Many thanks again!

Thanks to all for the discussion created! :handshake:

It looks like you probably have a different version of DeepLabCut on the machine doing the analysis. The name of the file is created programmatically, and the DeepCut part is from versions prior to 2.1 (according to the code here).
I’m sure there are some structural differences in the files too, so the new errors suggest it can’t read that old structure.

Update deeplabcut to the latest version on the analysis computer, and the problem should be solved.

Thank you again, that makes a lot of sense- it’s a centrally controlled facility and the DLC version won’t have been updated since it was installed back in ~2019. I’ll ask for it to be updated now!