MCPcopy Create free account
hub / github.com/OpenDriveLab/TCP / gen_sub_folder

Function gen_sub_folder

tools/gen_data.py:115–202  ·  view source on GitHub ↗
(folder_path)

Source from the content-addressed store, hash-verified

113 return seq_future_x, seq_future_y, seq_future_theta, seq_future_feature, seq_future_action, seq_future_action_mu, seq_future_action_sigma, seq_future_only_ap_brake, seq_input_x, seq_input_y, seq_input_theta, seq_front_img, seq_feature, seq_value, seq_speed, seq_action, seq_action_mu, seq_action_sigma, seq_x_target, seq_y_target, seq_target_command, seq_only_ap_brake
114
115def gen_sub_folder(folder_path):
116 route_list = [folder for folder in os.listdir(folder_path) if os.path.isdir(os.path.join(folder_path, folder))]
117 route_list = sorted(route_list)
118
119 total_future_x = []
120 total_future_y = []
121 total_future_theta = []
122
123 total_future_feature = []
124 total_future_action = []
125 total_future_action_mu = []
126 total_future_action_sigma = []
127 total_future_only_ap_brake = []
128
129 total_input_x = []
130 total_input_y = []
131 total_input_theta = []
132
133 total_front_img = []
134 total_feature = []
135 total_value = []
136 total_speed = []
137
138 total_action = []
139 total_action_mu = []
140 total_action_sigma = []
141
142 total_x_target = []
143 total_y_target = []
144 total_target_command = []
145
146 total_only_ap_brake = []
147
148 for route in route_list:
149 seq_data = gen_single_route(os.path.join(folder_path, route))
150 if not seq_data:
151 continue
152 seq_future_x, seq_future_y, seq_future_theta, seq_future_feature, seq_future_action, seq_future_action_mu, seq_future_action_sigma, seq_future_only_ap_brake, seq_input_x, seq_input_y, seq_input_theta, seq_front_img, seq_feature, seq_value, seq_speed, seq_action, seq_action_mu, seq_action_sigma, seq_x_target, seq_y_target, seq_target_command, seq_only_ap_brake = seq_data
153 total_future_x.extend(seq_future_x)
154 total_future_y.extend(seq_future_y)
155 total_future_theta.extend(seq_future_theta)
156 total_future_feature.extend(seq_future_feature)
157 total_future_action.extend(seq_future_action)
158 total_future_action_mu.extend(seq_future_action_mu)
159 total_future_action_sigma.extend(seq_future_action_sigma)
160 total_future_only_ap_brake.extend(seq_future_only_ap_brake)
161 total_input_x.extend(seq_input_x)
162 total_input_y.extend(seq_input_y)
163 total_input_theta.extend(seq_input_theta)
164 total_front_img.extend(seq_front_img)
165 total_feature.extend(seq_feature)
166 total_value.extend(seq_value)
167 total_speed.extend(seq_speed)
168 total_action.extend(seq_action)
169 total_action_mu.extend(seq_action_mu)
170 total_action_sigma.extend(seq_action_sigma)
171 total_x_target.extend(seq_x_target)
172 total_y_target.extend(seq_y_target)

Callers 1

gen_data.pyFile · 0.85

Calls 2

gen_single_routeFunction · 0.85
saveMethod · 0.45

Tested by

no test coverage detected