Alibaba-MIIL / ASL

Official Pytorch Implementation of: "Asymmetric Loss For Multi-Label Classification"(ICCV, 2021) paper
MIT License
722 stars 101 forks source link

target by object area #91

Open PT0X0E opened 2 years ago

PT0X0E commented 2 years ago

Hi, thanks for the work. I see in the code that targets are built by object areas as

output = torch.zeros((3, 80), dtype=torch.long)
for obj in target:
    if obj['area'] < 32 * 32:
        output[0][self.cat2cat[obj['category_id']]] = 1
    elif obj['area'] < 96 * 96:
        output[1][self.cat2cat[obj['category_id']]] = 1
    else:
        output[2][self.cat2cat[obj['category_id']]] = 1
target = output

and

for i, (inputData, target) in enumerate(train_loader):
    inputData = inputData.cuda()
    target = target.cuda()  # (batch,3,num_classes)
    target = target.max(dim=1)[0]

Why the targets are processed like this please?