ynu-yangpeng / GLMC

[CVPR2023] Global and Local Mixture Consistency Cumulative Learning for Long-tailed Visual Recognitions
69 stars 12 forks source link

关于数据集格式的一些小问题。 #13

Open SSSSamZhu opened 9 months ago

SSSSamZhu commented 9 months ago

`作者您好,很高兴你分享了这么好的一个工作。 由于我对比方法的需要,我把你们的方法用在新的数据集上,我进行了代码修改。我发现您的代码出现了一些前后矛盾的地方,期待您愿意抽出时间来为我答疑解惑。 首先在/GLMC-main/GLMC-2023/Trainer.py`路径下,

            for i, (inputs, targets) in enumerate(self.train_loader):
                print(inputs.shape)#torch.Size([64, 3, 256, 256])
                input_org_1 = inputs[0]
                input_org_2 = inputs[1]
                print("input_org_1.size():",input_org_1.size())#torch.Size([3, 256, 256])

这里应当是对单张图片进行操作的,后面又为何会在

def rand_bbox(size, lam):
    W = size[2]
    H = size[3]
    cut_rat = np.sqrt(1. - lam)
    cut_w = np.ceil(W * cut_rat).astype(int)
    cut_h = np.ceil(H * cut_rat).astype(int)

    # uniform
    cx = np.random.randint(W)
    cy = np.random.randint(H)

    bbx1 = np.clip(cx - cut_w // 2, 0, W)
    bby1 = np.clip(cy - cut_h // 2, 0, H)
    bbx2 = np.clip(cx + cut_w // 2, 0, W)
    bby2 = np.clip(cy + cut_h // 2, 0, H)

    return bbx1, bby1, bbx2, bby2

使用四维向量的格式?(后续继续也是使用了这个格式)是我在哪里忽略了什么吗?期待您的解答

Galaxy-N commented 8 months ago

input_org_1和input_org_2的shape似乎都是[64,3,256,256]