Closed Jeff-Gui closed 3 years ago
It looks like a new cell is trying to be assigned using a label that already exists. My first guess is that there are non-sequential labels that are causing issues.
@MekWarrior any thoughts?
DeepCell Tracking expects two image stacks in npz format. One is the raw data (X) and the other is a labeled image stack (y). Tracking expects that these integer labels will be contiguous and unique. As there is a "clean up" function run at the start of tracking to insure uniqueness, it sounds like there is something off with the input masks. What method did you use to produce the masks?
@Jeff-Gui you may want to try relabel_sequential
on your masks before tracking them.
Hi guys, thanks for the reply.
I have solved the problem through changing data type of the mask from numpy.dtype('uint8')
to numpy.dtype('uint16')
. Whether raw data type is uint8
or uint16
does not matter in my case. They generated the same result.
I noticed that uint8
is not enough for storing uids generated in utils.clean_up_annotations() in a long time lapse data. Therefore I made the pull request to transform matrix to int32
early in that function.
Closed by #42
Hi, I don't understand how input y should be like. Both documentations here and in deepcell.applications.cell_tracking said y should be int labeled images. I labeled my input mask using skimage.measure.label, fed it into model but only got the following error message:
File "/opt/anaconda3/envs/deepcell/lib/python3.7/site-packages/deepcell_tracking/tracking.py", line 222, in _create_new_track raise Exception('new_label already in annotated frame and frame > 0')
Exception: new_label already in annotated frame and frame > 0
Many thanks if you can explain a bit more.