(validation_files, sensor_a='mmwave_middle', sensor_b='rgb', imu_length=0)
| 290 | |
| 291 | |
| 292 | def validation_stack_triple(validation_files, sensor_a='mmwave_middle', sensor_b='rgb', imu_length=0): |
| 293 | x_sensor_a_val_1, x_sensor_a_val_2, x_sensor_b_val_1, x_sensor_b_val_2, x_imu_val_t, y_val_t = [], [], [], [], [], [] |
| 294 | for validation_file in validation_files: |
| 295 | print('---> Loading validation file: {}'.format(validation_file.split('/')[-1])) |
| 296 | |
| 297 | n_chunk_val, tmp_x_t, tmp_x_sensor_a_val_t, tmp_x_sensor_b_val_t, tmp_x_imu_val_t, tmp_y_val_t = \ |
| 298 | load_data_triple_timestamp(validation_file, sensor_a=sensor_a, sensor_b=sensor_b) |
| 299 | |
| 300 | tmp_y_val_t = tmp_y_val_t[0] |
| 301 | tmp_y_val_t = np.expand_dims(tmp_y_val_t, axis=1) |
| 302 | |
| 303 | len_val_i = tmp_y_val_t.shape[0] # the length of gt is always less than the length of data |
| 304 | # Prepare rgb validation data for t-0 and t-1 |
| 305 | tmp_x_sensor_a_val_1 = [] |
| 306 | for img_idx in range(0, (len_val_i)): |
| 307 | temp_x = tmp_x_sensor_a_val_t[0][img_idx] |
| 308 | tmp_x_sensor_a_val_1.append(temp_x) |
| 309 | |
| 310 | tmp_x_sensor_a_val_1 = np.array(tmp_x_sensor_a_val_1) |
| 311 | |
| 312 | tmp_x_sensor_b_val_1 = [] |
| 313 | for img_idx in range(0, (len_val_i)): |
| 314 | temp_x = tmp_x_sensor_b_val_t[0][img_idx] |
| 315 | tmp_x_sensor_b_val_1.append(temp_x) |
| 316 | |
| 317 | tmp_x_sensor_b_val_1 = np.array(tmp_x_sensor_b_val_1) |
| 318 | |
| 319 | tmp_x_sensor_a_val_2 = [] |
| 320 | for img_idx in range(1, (len_val_i+1)): |
| 321 | temp_x = tmp_x_sensor_a_val_t[0][img_idx] |
| 322 | tmp_x_sensor_a_val_2.append(temp_x) |
| 323 | |
| 324 | tmp_x_sensor_a_val_2 = np.array(tmp_x_sensor_a_val_2) |
| 325 | |
| 326 | tmp_x_sensor_b_val_2 = [] |
| 327 | for img_idx in range(1, (len_val_i + 1)): |
| 328 | temp_x = tmp_x_sensor_b_val_t[0][img_idx] |
| 329 | tmp_x_sensor_b_val_2.append(temp_x) |
| 330 | |
| 331 | tmp_x_sensor_b_val_2 = np.array(tmp_x_sensor_b_val_2) |
| 332 | |
| 333 | # for flownet |
| 334 | if any(x in sensor_a for x in ['mmwave', 'depth']): |
| 335 | tmp_x_sensor_a_val_1 = np.repeat(tmp_x_sensor_a_val_1, 3, axis=-1) |
| 336 | tmp_x_sensor_a_val_2 = np.repeat(tmp_x_sensor_a_val_2, 3, axis=-1) |
| 337 | |
| 338 | if any(x in sensor_b for x in ['mmwave', 'depth']): |
| 339 | tmp_x_sensor_b_val_1 = np.repeat(tmp_x_sensor_b_val_1, 3, axis=-1) |
| 340 | tmp_x_sensor_b_val_2 = np.repeat(tmp_x_sensor_b_val_2, 3, axis=-1) |
| 341 | |
| 342 | # progressive stack file by file |
| 343 | y_val_t = np.vstack((y_val_t, tmp_y_val_t)) if np.array(y_val_t).size else tmp_y_val_t |
| 344 | |
| 345 | x_sensor_a_val_1 = np.vstack((x_sensor_a_val_1, tmp_x_sensor_a_val_1)) \ |
| 346 | if np.array(x_sensor_a_val_1).size else tmp_x_sensor_a_val_1 |
| 347 | x_sensor_a_val_2 = np.vstack((x_sensor_a_val_2, tmp_x_sensor_a_val_2)) \ |
| 348 | if np.array(x_sensor_a_val_2).size else tmp_x_sensor_a_val_2 |
| 349 |
nothing calls this directly
no test coverage detected