def __init__(self, video_path, list_path, patch_size, window_len, rotate=10, scale=1.2, full_size=640, is_train=True): super(VidListv2, self).__init__() self.data_dir = video_path self.list_path = list_path self.window_len = window_len normalize = transforms.Normalize(mean=(128, 128, 128), std=(128, 128, 128)) self.transforms1 = transforms.Compose([ transforms.RandomRotate(rotate), # transforms.RandomScale(scale), transforms.ResizeandPad(full_size), transforms.RandomCrop(patch_size), transforms.ToTensor(), normalize ]) self.transforms2 = transforms.Compose([ transforms.ResizeandPad(full_size), transforms.ToTensor(), normalize ]) self.is_train = is_train self.read_list()
def __init__(self, video_path, patch_size, window_len, rotate=10, scale=1.2, full_size=640, is_train=True): super(VidListv2, self).__init__() self.data_dir = video_path self.window_len = window_len normalize = transforms.Normalize(mean=(128, 128, 128), std=(128, 128, 128)) self.transforms1 = transforms.Compose([ transforms.RandomRotate(rotate), transforms.ResizeandPad(full_size), transforms.RandomCrop(patch_size), transforms.ToTensor(), normalize ]) self.transforms2 = transforms.Compose([ transforms.ResizeandPad(full_size), transforms.ToTensor(), normalize ]) self.is_train = is_train self.list = list_sequences(video_path, set_ids=list( range(12))) # training sets: 0~11
def __init__(self, video_path, list_path, patch_size, window_len, rotate = 10, scale = 1.2, full_size = 640, is_train=True): super(VidListv2, self).__init__() csv_path = "/raid/codes/CorrFlows/GOT_10k.csv" filenames = open(csv_path).readlines() frame_all = [filename.split(',')[0].strip() for filename in filenames] nframes = [int(filename.split(',')[1].strip()) for filename in filenames] self.data_dir = video_path self.list = frame_all self.window_len = window_len self.nframes = nframes normalize = transforms.Normalize(mean = (128, 128, 128), std = (128, 128, 128)) self.transforms1 = transforms.Compose([ transforms.RandomRotate(rotate), # transforms.RandomScale(scale), transforms.ResizeandPad(full_size), transforms.RandomCrop(patch_size), transforms.ToTensor(), normalize]) self.transforms2 = transforms.Compose([ transforms.ResizeandPad(full_size), transforms.ToTensor(), normalize]) self.is_train = is_train