(self, img_path_list)
| 178 | random.shuffle(self.fut_traj_list) |
| 179 | |
| 180 | def read_img_list(self, img_path_list): |
| 181 | video_size, fps, max_num_frames, skip_frms_num = \ |
| 182 | self.video_size, self.fps, self.max_num_frames, self.skip_frms_num |
| 183 | |
| 184 | img_path_list = img_path_list[skip_frms_num:] # skip some frames |
| 185 | |
| 186 | tensor_frms = load_image_list_to_tensors(img_path_list) |
| 187 | tensor_frms = torch.stack(tensor_frms, dim=0) # T, H, W, C |
| 188 | |
| 189 | tensor_frms = pad_last_frame( |
| 190 | tensor_frms, max_num_frames |
| 191 | ) # the len of indices may be less than num_frames, due to round error\ |
| 192 | tensor_frms = tensor_frms.permute(0, 3, 1, 2) # [T, H, W, C] -> [T, C, H, W] |
| 193 | tensor_frms = resize_for_rectangle_crop(tensor_frms, video_size, reshape_mode=self.reshape_mode) |
| 194 | tensor_frms = (tensor_frms - 127.5) / 127.5 |
| 195 | return max_num_frames, tensor_frms |
| 196 | |
| 197 | def __getitem__(self, index): |
| 198 | while True: |
no test coverage detected