TransUNet
TransUNet copied to clipboard
something about custom dataset
Thanks for your excellent work. While I try to make my own dataset, I meet some troubles.
My first question is that what the dimensions of "image" and "label" in the Dataloader module.
def __getitem__(self, idx):
if self.split == "train":
slice_name = self.sample_list[idx].strip('\n')
data_path = os.path.join(self.data_dir, slice_name+'.npz')
data = np.load(data_path)
image, label = data['image'], data['label']
else:
vol_name = self.sample_list[idx].strip('\n')
filepath = self.data_dir + "/{}.npy.h5".format(vol_name)
data = h5py.File(filepath)
image, label = data['image'][:], data['label'][:]
sample = {'image': image, 'label': label}
if self.transform:
sample = self.transform(sample)
sample['case_name'] = self.sample_list[idx].strip('\n')
return sample
In the above code, could you tell me the shape of the sample['image'] and sample['label'] ?
Sorry for the late reply. For slice, the shape of ['image'] and sample['label'] is the original shape (512, 512). For volume (e.g. testing cases with ".h5" format), the shape should be (512, 512, Z) where Z is not fixed.
I have the same question,Can I used this code on 2d dataset
I have the same question,Can I used this code on 2d dataset
Yes it can, in this paper, the resolution of input image is 512*512.
I have the same question,Can I used this code on 2d dataset
Yes it can, in this paper, the resolution of input image is 512*512.
Emm, in the original paper, I see that image size is cropped into 224*224?
I have the same question,Can I used this code on 2d dataset
Yes it can, in this paper, the resolution of input image is 512*512.
but, in the test ,h5 format file is need, how to solve it? please