Beispiel #1
0
 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()
Beispiel #2
0
    def __init__(self,
                 video_path,
                 list_path,
                 patch_size,
                 rotate=10,
                 scale=1.2,
                 is_train=True,
                 moreaug=True):
        super(VidListv1, self).__init__()
        self.data_dir = video_path
        self.list_path = list_path
        normalize = transforms.Normalize(mean=(128, 128, 128),
                                         std=(128, 128, 128))

        t = []
        if rotate > 0:
            t.append(transforms.RandomRotate(rotate))
        if scale > 0:
            t.append(transforms.RandomScale(scale))
        t.extend([
            transforms.RandomCrop(patch_size, seperate=moreaug),
            transforms.RandomHorizontalFlip(),
            transforms.ToTensor(), normalize
        ])

        self.transforms = transforms.Compose(t)

        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
Beispiel #4
0
    def __init__(self,
                 video_path,
                 list_path,
                 patch_size,
                 rotate=10,
                 scale=1.2,
                 is_train=True,
                 moreaug=True):
        super(VidListv1, self).__init__()
        csv_path = "/raid/codes/CorrFlows/functional/feeder/dataset/oxuva.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.nframes = nframes
        normalize = transforms.Normalize(mean=(128, 128, 128),
                                         std=(128, 128, 128))

        t = []
        if rotate > 0:
            t.append(transforms.RandomRotate(rotate))
        if scale > 0:
            t.append(transforms.RandomScale(scale))
        t.extend([
            transforms.RandomCrop(patch_size, seperate=moreaug),
            transforms.RandomHorizontalFlip(),
            transforms.ToTensor(), normalize
        ])

        self.transforms = transforms.Compose(t)

        self.is_train = is_train
Beispiel #5
0
    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/UVC/libs/GOT-new.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_1(full_size),
            transforms.RandomCrop(patch_size),
            transforms.ToTensor(),
            normalize
        ])
        self.transforms2 = transforms.Compose([
            transforms.ResizeandPad_1(full_size),
            transforms.ToTensor(), normalize
        ])

        self.is_train = is_train
        self.video_list = []
        for filename in filenames:
            record = VideoRecord()
            record.path = os.path.join(video_path,
                                       filename.split(',')[0].strip())
            record.num_frames = int(filename.split(',')[1].strip(
            ))  #len(glob.glob(os.path.join(video_path, '*.jpg')))
            record.label = filename.split(',')[0].strip()
            self.video_list.append(record)
Beispiel #6
0
    def __init__(self,
                 video_path,
                 list_path,
                 patch_size,
                 rotate=10,
                 scale=1.2,
                 is_train=True,
                 moreaug=True):
        super(VidListv1, self).__init__()
        csv_path = "/raid/codes/UVC/libs/GOT-new.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.nframes = nframes
        normalize = transforms.Normalize(mean=(128, 128, 128),
                                         std=(128, 128, 128))

        t = []
        if rotate > 0:
            t.append(transforms.RandomRotate(rotate))
        if scale > 0:
            t.append(transforms.RandomScale(scale))
        t.extend([
            transforms.RandomCrop(patch_size, seperate=moreaug),
            transforms.RandomHorizontalFlip(),
            transforms.ToTensor(), normalize
        ])

        self.transforms = transforms.Compose(t)

        self.is_train = is_train
        self.video_list = []
        for filename in filenames:
            record = VideoRecord()
            record.path = os.path.join(video_path,
                                       filename.split(',')[0].strip())
            record.num_frames = int(filename.split(',')[1].strip(
            ))  # len(glob.glob(os.path.join(video_path, '*.jpg')))
            record.label = filename.split(',')[0].strip()
            self.video_list.append(record)
Beispiel #7
0
	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