Failed when applied to mice dataset
STAR-811 opened this issue · comments
hi! when i I use the demo images command in readme, the Maskcut can classify different instances:
Following the instructions, I typed in following command:
python demo.py --img-path imgs/00000.jpg --N 6 --tau 0.2 --vit-arch base --patch-size 8
and change parameters. however, the Maskcut always treat different mice as the same instance. What can I do to solve the problem?
Hi! MaskCut should be able to separate disconnected masks as separate instances. Could you experiment with larger fixed_size parameters and varying tau values to assess whether this adjustment improves its performance?
In case you still have troubles on separating all the disconnected masks, you can consider using this package to identify these isolated masks as individual objects within a binary mask. Following is the sample codes. You can add it after this line
from scipy.ndimage import label
labeled_array, num_objects = label(binary_pseudo_mask)
# sample results (1: object 1; 2: object 2, ..., n: object n):
# array([[0, 0, 1, 1, 0, 0],
[0, 0, 0, 1, 0, 0],
[2, 2, 0, 0, 3, 0],
[0, 0, 0, 4, 0, 0]])
Hope it helps.