anthonyweidai / SvANet

Official implementation of "Exploiting Scale-Variant Attention for Segmenting Small Medical Objects"
MIT License
28 stars 1 forks source link

Can't get correct mask #10

Open GOfBlue opened 2 hours ago

GOfBlue commented 2 hours ago

I output the values ​​of PredMask and Target in maskRegion.py, and the results are as follows. Why are they all 1? The masks obtained in this way should all be white images, right?

Target: tensor([[[1, 1, 1, ..., 1, 1, 1], [1, 1, 1, ..., 1, 1, 1], [1, 1, 1, ..., 1, 1, 1], ..., [1, 1, 1, ..., 1, 1, 1], [1, 1, 1, ..., 1, 1, 1], [1, 1, 1, ..., 1, 1, 1]],

    [[1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     ...,
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1]],

    [[1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     ...,
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1]],

    ...,

    [[1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     ...,
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1]],

    [[1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     ...,
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1]],

    [[1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     ...,
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1],
     [1, 1, 1,  ..., 1, 1, 1]]], device='cuda:0', dtype=torch.uint8)

Tiny_10 IoU: [0.9989649 0.9000182 0.75655156 0.32659763] Tiny_10 Dice: [0.99948215 0.9473785 0.8614055 0.49238387]

anthonyweidai commented 2 hours ago

Please check https://github.com/anthonyweidai/SvANet/blob/main/lib/metrics/maskRegion.py#L39.

GOfBlue commented 1 hour ago

Please check https://github.com/anthonyweidai/SvANet/blob/main/lib/metrics/maskRegion.py#L39. 屏幕截图 2024-09-20 135729

look,I have not made any modifications to maskRegion.py, but both PredMask and Target are all 0. Please tell me why?