Skip to content

Chaining loaded pickle files with transforms #1877

Answered by Nic-Ma
PCaesar18 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @PCaesar18 ,

May I know what's your error message when you try to modify from LoadTarJpeg? Maybe just change to:

files = glob.glob(os.path.join(GAN_input_data_folder_name,'**/*.pkl'),recursive = True)

class LoadPickleD(Transform):
    def __call__(self, data):
       pickleFile = open(data, 'rb')
       return pickle.load(pickleFile)

transform = Compose([
    LoadPickleD(),
    AddChannelD(keys="CT"),
    ResizeD(keys="CT", spatial_size=[64, 64]),
    ToTensorD(keys="CT"),
])
test_data = CacheDataset(files, transform)

Thanks.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@PCaesar18
Comment options

@Nic-Ma
Comment options

Answer selected by wyli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants