Data_Block_API to read numpy Arrays

I’m not sure if you are looking for something like this, but i managed to load image data previously saved as Tensor (could be numpy array / txt)

class CustomImageItemList(ImageItemList):
    def open(self, fn):
        return Image(torch.load(fn))

lst = CustomImageItemList.from_folder(Path('clean_pt'), '.pt')
2 Likes