skip_frms_num: ignore the first and the last xx frames, avoiding transitions.
(self,
data_dir,
video_size,
fps,
max_num_frames,
skip_frms_num=0, # * Set to 7 for nuplan, 0 for others
prefix_prompt="",
n_repeat_of_actions=None,
n_fut_traj_points=8,
p_mask_out_heading=0,
p_drop_action_caption=0,
p_drop_traj=0,
traj_key='traj_fut',
reshape_mode='center',
n_subset=None, # 30
ind_subset=None, # 0,...,29
manual_total_length=None,
manual_total_length_mode='sequential',
# * For nuplan only
token_json=None,
# * Human Drive Token for YouTube and nuplan
# * - True for nuPlan and YouTube
# * - False for Carla
with_human_drive_token=False,
always_apply_human_drive_token=False, # * Apply human_drive_token when traj is valid
shuffle_traj_as_non_experts=False,
p_use_extrapolate_traj=0.,
**kwargs)
| 12 | class SharedDataset(Dataset): |
| 13 | |
| 14 | def __init__(self, |
| 15 | data_dir, |
| 16 | video_size, |
| 17 | fps, |
| 18 | max_num_frames, |
| 19 | skip_frms_num=0, # * Set to 7 for nuplan, 0 for others |
| 20 | prefix_prompt="", |
| 21 | n_repeat_of_actions=None, |
| 22 | n_fut_traj_points=8, |
| 23 | p_mask_out_heading=0, |
| 24 | |
| 25 | p_drop_action_caption=0, |
| 26 | p_drop_traj=0, |
| 27 | |
| 28 | |
| 29 | traj_key='traj_fut', |
| 30 | reshape_mode='center', |
| 31 | n_subset=None, # 30 |
| 32 | ind_subset=None, # 0,...,29 |
| 33 | manual_total_length=None, |
| 34 | manual_total_length_mode='sequential', |
| 35 | |
| 36 | # * For nuplan only |
| 37 | token_json=None, |
| 38 | |
| 39 | # * Human Drive Token for YouTube and nuplan |
| 40 | # * - True for nuPlan and YouTube |
| 41 | # * - False for Carla |
| 42 | with_human_drive_token=False, |
| 43 | always_apply_human_drive_token=False, # * Apply human_drive_token when traj is valid |
| 44 | |
| 45 | shuffle_traj_as_non_experts=False, |
| 46 | |
| 47 | p_use_extrapolate_traj=0., |
| 48 | |
| 49 | **kwargs): |
| 50 | """ |
| 51 | skip_frms_num: ignore the first and the last xx frames, avoiding transitions. |
| 52 | """ |
| 53 | super(SharedDataset, self).__init__() |
| 54 | |
| 55 | self.video_list = [] |
| 56 | self.captions_list = [] |
| 57 | self.num_frames_list = [] |
| 58 | self.fps_list = [] |
| 59 | self.fut_traj_list = [] |
| 60 | self.lidar_pc_token_list = [] |
| 61 | |
| 62 | self.video_size = video_size |
| 63 | self.fps = fps |
| 64 | self.max_num_frames = max_num_frames |
| 65 | self.skip_frms_num = int(skip_frms_num) |
| 66 | self.prefix_prompt = prefix_prompt |
| 67 | |
| 68 | self.n_repeat_of_actions = n_repeat_of_actions |
| 69 | |
| 70 | self.n_fut_traj_points = n_fut_traj_points |
| 71 | self.p_mask_out_heading = p_mask_out_heading |
nothing calls this directly
no test coverage detected