Can you customize a .toml file to save a video's id_image_size?

14 views
Skip to first unread message

Carolyn Tett

unread,
Aug 28, 2024, 10:14:42 AMAug 28
to idtracker.ai users group
Hi all,

I am really enjoying using idtracker.ai in my animal behavior lab. We are processing a lot of videos, and we need to match animal ID's across almost 100 videos using idmatcher. To do this, from what I understand, the id_image_size of all of our videos must be the same.

Our current procedure for ensuring id_image_size is the same is to duplicate a Master video's .toml file, changing the video path to where the Matching video is located, and subsequently train Matching videos using the Master's video parameters. The Master's .toml file, however, does not automatically save the critical id_image_size variable. This, we have to hunt down in the Master's session.json file, then copy over to its .toml.

This procedure works, but it is not ideal given that about 1/3 of our videos will be Master videos for the other 2/3.

Is there a way to customize what video parameters are automatically saved to a video's .toml file?

Thanks,
Carolyn Tett

idtrackerai

unread,
Aug 28, 2024, 12:20:15 PMAug 28
to idtracker.ai users group
Hi Carolyn,

Thanks for reaching out, happy to read you like our software :)

You are right, the id_image_size has to be the same to perform identity matching with idmatcherai.

The .toml parameters file generated in the Segmentation GUI contains only the basic parameters, so id_image_size is never included. id_image_size, if not defined by the user, is set automatically during the tracking process and this process never modifies the input .toml file.

If you want to perform idmatching, I would recommend you to always define id_image_size to a specific value for all your sessions (Master included). You can do this by adding the line "id_image_size = 50" (for example) into your .toml parameters file or adding this parameter in the command like "idtrackerai --load ... --id_image_size 50" (I think you already know this).
In case you have more common parameters shared in all your tracking sessions, you can create a general parameters file (for example base_configuration.toml) and load it like "idtrackerai --load base_configuration.toml my_video_specific_configuration.toml --track".

I would decide the value for id_image_size based on the automatic value assigned in a session you already tracked. In case your Master videos are not very different from one to the other, I would use the same id_image_size for all of them.

There is also another way of doing this. You can use knowledge_transfer (with or without identity_transfer) from Master to Matching making Matching to use the Master's identification network as the initial state during training. This makes Matching to adopt the id_image_size of Master automatically. Check the documentation here.

I hope this helps, and please ask me again if I didn't answered precisely.
Jordi
Reply all
Reply to author
Forward
0 new messages