from ds1 import PatchDataset from torch.utils.data import DataLoader from torchvision.transforms import Normalize import numpy as np import torch ffile = '/Users/dennistrujillo/Downloads/park_sam_cx5b_s0_ff_with_Pb_000402.ge3' dfile = '/Users/dennistrujillo/Downloads/dark_before_000384.ge3' bs = 1 dataset = PatchDataset(ffile, dfile, nFrames=1440) patches_array = np.array(dataset.patches) fnum_array = np.array(dataset.f_nums) print(len(dataset)) index_numbers = list(range(len(dataset.patches))) p_dict = dict(zip(index_numbers,zip(dataset.f_nums,dataset.patches))) torch.save(p_dict,'patches_402.pt')