BNNPreprocess / test.py
Dennis Trujillo
test.py has been updated to save the an index, frame num, and patch to a dict
8b54636
raw
history blame contribute delete
615 Bytes
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')