Manual outlier selection for refinement GUI


Apologies if this is a duplicate, but none of the previous topics or GitHub issues I saw on this answered my question.

My question is: is it possible to manually select outliers for use with the refinement GUI?

In other words, is there a function that I can give a list of frames to and it’ll generate the machinelabels file (or a set of options to extract_outlier_frames that will accomplish this)? Mostly just wanted to check before I started coding it myself. My issue is that none of the outlieralgorithm/extractionalgorithm combos really get at the frames where I think DeepLabCut is doing a bad job on my dataset, but it’s doing a pretty good job at the ones it does get right so I’d rather refine than retrain from scratch.

Best regards,

John Barrett

funnily enough, this will be in the next release! Just beta testing tonight :slight_smile:

1 Like

That is very exciting news! When you say ‘the next release’, does this mean we should be on the lookout for 2.0.5 soon? :smiley:

Yes! Hopefully by the end of the week :slight_smile:

1 Like

Just pulled DLC 2.0.5 and had a quick play with the manual outlier selection GUI, seems to be exactly what I’m after, thanks! Just a couple comments:

First, Windows users will need to give themselves the symlink permission (see for it to work, which requires them to be able to edit group policies. I think this also affects project creation but there’s an argument you can pass to force it to copy the videos instead, maybe this should be added here as well? (Apologies if it’s already there and I missed it.)

The first time I tried it didn’t work because the machinelabels file didn’t exist yet, is this a bug or is the intention to do a first pass automatic outlier selection first? If the former, it’s like a 4 line fix (I’ve fixed it on my local copy).

Thanks again for adding this feature and for developing this toolbox in general! :smiley:

1 Like

Hi John,

could you share your fix? I am experiencing the same problem (manual outlier selection on windows isn’t working, clicking on “grab frames” doesn’t seem to do anything, getting the error: FileNotFoundError: File path\machinelabels-iter1.h5 does not exist)


The way I fixed it was to insert the following between lines 310 & 311 of refine_training_dataset/

if not os.path.isfile(self.machinefile):

then indent the original lines 311-315 so they’re inside the else clause. I haven’t tested it, but an alternative, slightly cleaner way would be to only indent lines 311-313 then insert

if not os.path.isfile(self.machinefile):
    DataCombined = DF

between lines 310 and 311.

Hope that helps!

1 Like

Ah’ thanks for catching that - we (falsely) assumed most would run an automatic step then supplement with the manual extraction. So, for now if you don’t want to edit the code, just run automatic as the OP suggests :slight_smile: we will fix in the next update!

1 Like

Thanks a lot! I’ve edited the code using the second option and it all works fine now :slight_smile: