NVlabs / GroupViT

Official PyTorch implementation of GroupViT: Semantic Segmentation Emerges from Text Supervision, CVPR 2022.
https://arxiv.org/abs/2202.11094
Other
725 stars 52 forks source link

Mask Probing #34

Closed PardoAlejo closed 2 years ago

PardoAlejo commented 2 years ago

Hi guys,

Do you have any plans on releasing the code for evaluating the mask quality (mask probing) mentioned in appendix C.2. table C.2.?? It would be really helpful. Thank you!.

Regards

xvjiarui commented 2 years ago

Hi @PardoAlejo

That part is not cleaned. But I could provide you some part of the code

jac = 0
for o in objects:
    masko = mask == o
    intersection = masko * th_attn
    intersection = torch.sum(torch.sum(intersection, dim=-1), dim=-1)
    union = (masko + th_attn) > 0
    union = torch.sum(torch.sum(union, dim=-1), dim=-1)
    jaco = intersection / union
    jac += max(jaco)
jac /= len(objects)
jacs += jac

It's the same as DINO.

PardoAlejo commented 2 years ago

Thank you @xvjiarui