Deeplabcut: Possible to train maDLC on 4 animals but run inference on 6 animals?

Created on 21 Aug 2020  路  7Comments  路  Source: DeepLabCut/DeepLabCut

Hi
I have a DLC NN trained to do inference on 4 animals - and it works well.

I added 2 animals to the config.yaml file and tried labeling a 6 animal video with this trained NN and DLC didn't do very well. Is it possible to do this? If so, what parameters should I try and change?

Thanks so much!

maDLC

Most helpful comment

Hi. Sorry for the delay.

So I created the .mp4 to check the detections, and indeed, all the animals appear to be tracked:

https://drive.google.com/file/d/1obvdKvhLXlkgtyvnWcW7mVi0OXBJTfRk/view?usp=sharing

To be clear, the NNs were trained on 4 animals only (and actually a slightly different camera angle), so this is great results.

Thanks so much, I will work on the next steps and start issues if they are present.

All 7 comments

Hi @catubc, you'll need to set topktoretain to 6 in the inference_cfg.yaml (under the dlc-models/.../test directory). The tracklet GUI will likely complain afterwards though, but I'm working on that use case 馃槃

(It doesn鈥檛 complain if you add 6 individuals to jr config.yaml)

Hi thanks for the advice.

I made both changes, but seems only up to 4 animals are labeled at once and a lot of the time the animals aren't labeled at all (the 4 animal videos are much better than this):

https://drive.google.com/file/d/1jNsfJrRao9NZ-0t6biSLuSVjNC2GVBxF/view?usp=sharing

Is there something else I could try?

Thanks so much!

can you post the raw ...full.mp4 for this video with 6 animals, having changed config.yaml to have

individuals:
- indv1
- indv2
- indv3
- indv4
- indv5
- indv6

and
topktoretain = 6 ?

Hi.

So I changed the config.yaml individuals to:

  • indv1
    ...
  • indv7

(there are actually 7 animals in the video).

And "topktoretain" to 7 as well. I then made a bodyparts video using the bx.pickle file (the full.pickle file can't be loaded, I get a "KeyError: 'header'" message; and the bx.pickle is the only file I've used in the past that works to generate videos).

The video still only has up to 4 animals labeled at a time:

https://drive.google.com/file/d/1z1K6ogJPWRZEpGgBU8AAre0qtpP5VuNu/view?usp=sharing

DLC is otherwise pretty good at labeling up to 4 individuals in the 7-animal videos.

You would need to run video analysis first with the modified config.yaml, not just the tracklet step.

In the main GUI, can you run analyze videos, and then also check that you want to create a full.mp4 video to check the detections; there must be 7 in this (unless the animals do not look like the 4 you trained with; this configuration assumes all animals look identical)

Hi. Sorry for the delay.

So I created the .mp4 to check the detections, and indeed, all the animals appear to be tracked:

https://drive.google.com/file/d/1obvdKvhLXlkgtyvnWcW7mVi0OXBJTfRk/view?usp=sharing

To be clear, the NNs were trained on 4 animals only (and actually a slightly different camera angle), so this is great results.

Thanks so much, I will work on the next steps and start issues if they are present.

Was this page helpful?
0 / 5 - 0 ratings