JStehouwer / FFD_CVPR2020

108 stars 22 forks source link

Are label information leaked in testing process? #14

Closed insomnia1996 closed 3 years ago

insomnia1996 commented 3 years ago

Thanks for uploading your code and dataset. After a short view I'm considering your predicting process is like: generating masks with scripts on test data, using test data and their masks to feed into trained model to predict. But I was confused that in your test.py file, you get dataset like this:

def get_dataset():
  return Dataset('test', BATCH_SIZE, CONFIG['img_size'], CONFIG['map_size'], CONFIG['norms'], SEED)

then you differ masks of real and fake photos by using their labels in dataset.py:

  def __getitem__(self, index):
    im_name = self.images[index]
    img = self.load_image(im_name)
    if self.label_name == 'Real':
      msk = torch.zeros(1,19,19)
    else:
      msk = self.load_mask(im_name.replace('Fake/', 'Mask/'))
    return {'img': img, 'msk': msk, 'lab': self.label, 'im_name': im_name}

Is it fair to distinguish masks by label_name in the testing process? I also wonder how to create Mask/ folder when you predict fake images that donot have corresponding real images?

If i misunderstand anything please correct me, thanks a lot!