Skip to content

Conversation

@JulianAlvarezdeGiorgi
Copy link
Contributor

A new Swap identities button was added to the track refinement GUI. Two text boxes were added to choose the animal identities you want to swap, and some options to select the frames to swap:

  • A time window selected with the flags (when there are two flags fixed)
  • A single frame (when there's a single flag fix)
  • And from the current frame till the end (when there are no flags fixed).

Also, a function called adapt_labeled_data_to_new_project was added, it allows you to adapt up to some point old dataset, for example, if you have an old dataset with some body parts and now you want to add body parts to the project, this function keeps the old points while allowing the new ones to be labeled. It was useful for me.

Julian ALVAREZ DE GIORGI added 2 commits July 19, 2024 15:12
@MMathisLab MMathisLab requested a review from jeylau July 19, 2024 14:33
@jeylau jeylau self-assigned this Jul 23, 2024
@jeylau
Copy link
Contributor

jeylau commented Jul 23, 2024

Hi @JulianAlvarezdeGiorgi, thanks a lot for your PR, I'm reviewing it! The UI part looks good so far.
Could you just clarify what your adapt_labeled_data_to_new_project function does?
Unless something has changed, body parts that are newly added to the config are seamlessly handled (and old data are converted to the newer multiindex format under the hood with guarantee_multiindex_rows).

@JulianAlvarezdeGiorgi
Copy link
Contributor Author

Hello @jeylau , I created this function because I had originally created a dataset with 14 body parts. Later I decided to make another project, where I kept the body parts of the previous project (these 14) but added new body parts. As I already had many frames with the 14 labels, I wanted to be able to transfer them to the new project, and only have to label the new body parts. For this, I created a new project, with all the body parts I was interested in (old and new), I kept the “labeled-data” folder of the old project, and I used the adapt_labeled_data_to_new_project function to add the new body parts to the .csv and .h5 files, so I could label the new bodyparts from the GUI.

I didn't manage to do this by adding the new body parts to the config file, but I may have skipped a step.

@jeylau
Copy link
Contributor

jeylau commented Jul 23, 2024

I understand better. Normally, after adding new body parts to your config and opening the labeling GUI, you should automatically be warned that new body parts were detected, and asked whether or not you want to display all of them or only the new ones while labeling.

@JulianAlvarezdeGiorgi
Copy link
Contributor Author

Is this true with DLC 2.3.9?
Because for me, it was not like this, if I extract new frames I can label all the body parts, but on the already extracted and labeled frames, I don't have the option to label the new body parts.

@jeylau
Copy link
Contributor

jeylau commented Jul 25, 2024

Yes, it's a feature we had even before the napari-deeplabcut labeling plugin. I tested it this morning again. Maybe try pip install -U napari-deeplabcut just to make sure you're running the latest version.

Copy link
Contributor

@jeylau jeylau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, @JulianAlvarezdeGiorgi, thanks a lot! I'm not sure there is a need for adapt_labeled_data_to_new_project, but I'll leave it up to @MMathisLab to decide.
Before merging, could you please run black to automatically correct a couple of formatting inconsistencies?

@MMathisLab MMathisLab requested a review from AlexEMG July 25, 2024 14:56
@MMathisLab
Copy link
Member

If useful, seems okay to me!

@JulianAlvarezdeGiorgi
Copy link
Contributor Author

Perfect, I'll try updating deeplabcut then. I've just run the black formatting, however, it changed a lot of files that I didn't even touch, should I have run it with a specific flag/configuration?

Thank you very much for your help and your willingness to collaborate !

@MMathisLab MMathisLab added the enhancement New feature or request label Aug 13, 2024
@MMathisLab MMathisLab self-requested a review August 13, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request maDLC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants