weigertlab / trackastra

BSD 3-Clause "New" or "Revised" License
55 stars 12 forks source link

use_gt argument in the CTCData #19

Closed kevinyamauchi closed 1 week ago

kevinyamauchi commented 1 week ago

Hello! I am trying to train trackastra with my own data and I was wondering what the use_gt argument in the CTCData init method does. It see that it will look into the 01_ST/SEG directory in the FLUO-N2DL-HeLa example folder (see screenshot below), but I'm not sure I understand what purpose it has in the training.

Looking at the CTC spec, it looks like it contains "silver truth" segmentations, but I'm not sure what I should put in there. Should I just copy the segmentations into that directory (using the same naming pattern as the TRA images)?

Screenshot 2024-11-13 at 17 20 19
bentaculum commented 1 week ago

Hi @kevinyamauchi, use_gt=True will try to do a union of xx_ST/SEG and xx_GT/TRA masks for all masks available in the GT TRA folder. In CTC datasets, the GT TRA masks are sometimes only points/disks, while the ST SEG masks are dense instance segmentations.

If you don't have separate silver truth SEG masks, the dataloader will simply load the xx_GT/TRA folder.

Hope this helps.

kevinyamauchi commented 1 week ago

Thanks for the quick reply, @bentaculum !

Just to make sure I understand correctly, if I want to use the masks in xx_GT/TRA, I should set use_gt=False? Or do I set use_gt=True and when it doesn't find a xx_ST/SEG directory it falls back on just the masks in xx_GT/TRA?

bentaculum commented 1 week ago

For training please always use use_gt=True, which includes the fallback behaviour you describe. use_gt=False is legacy from when we used CTCData class also for prediction.

kevinyamauchi commented 1 week ago

Got it. Thank you!