Fixes to config.json for heading derivates and map rendering

This commit is contained in:
Ruben van de Ven 2024-12-28 21:02:07 +01:00
parent e9defb211f
commit fb83554c37
5 changed files with 240 additions and 91 deletions

130
EXPERIMENTS/config.json Normal file
View file

@ -0,0 +1,130 @@
{
"batch_size": 512,
"grad_clip": 1.0,
"learning_rate_style": "exp",
"learning_rate": 0.01,
"min_learning_rate": 1e-05,
"learning_decay_rate": 0.9999,
"prediction_horizon": 50,
"minimum_history_length": 10,
"maximum_history_length": 80,
"map_encoder": {
"PEDESTRIAN": {
"heading_state_index": [2, 3],
"patch_size": [
50,
10,
50,
90
],
"map_channels": 3,
"hidden_channels": [
10,
20,
10,
1
],
"output_size": 32,
"masks": [
5,
5,
5,
5
],
"strides": [
1,
1,
1,
1
],
"dropout": 0.5
}
},
"k": 1,
"k_eval": 25,
"kl_min": 0.07,
"kl_weight": 100.0,
"kl_weight_start": 0,
"kl_decay_rate": 0.99995,
"kl_crossover": 400,
"kl_sigmoid_divisor": 4,
"rnn_kwargs": {
"dropout_keep_prob": 0.75
},
"MLP_dropout_keep_prob": 0.9,
"enc_rnn_dim_edge": 32,
"enc_rnn_dim_edge_influence": 32,
"enc_rnn_dim_history": 32,
"enc_rnn_dim_future": 32,
"dec_rnn_dim": 128,
"q_z_xy_MLP_dims": null,
"p_z_x_MLP_dims": 32,
"GMM_components": 1,
"log_p_yt_xz_max": 6,
"N": 1,
"K": 25,
"tau_init": 2.0,
"tau_final": 0.05,
"tau_decay_rate": 0.997,
"use_z_logit_clipping": true,
"z_logit_clip_start": 0.05,
"z_logit_clip_final": 5.0,
"z_logit_clip_crossover": 300,
"z_logit_clip_divisor": 5,
"dynamic": {
"PEDESTRIAN": {
"name": "SingleIntegrator",
"distribution": false,
"limits": {}
}
},
"state": {
"PEDESTRIAN": {
"position": [
"x",
"y"
],
"velocity": [
"x",
"y"
],
"acceleration": [
"x",
"y"
]
}
},
"pred_state": {
"PEDESTRIAN": {
"velocity": [
"x",
"y"
]
}
},
"log_histograms": false,
"dynamic_edges": "yes",
"edge_state_combine_method": "sum",
"edge_influence_combine_method": "attention",
"edge_addition_filter": [
0.25,
0.5,
0.75,
1.0
],
"edge_removal_filter": [
1.0,
0.0
],
"offline_scene_graph": "yes",
"incl_robot_node": false,
"node_freq_mult_train": false,
"node_freq_mult_eval": false,
"scene_freq_mult_train": false,
"scene_freq_mult_eval": false,
"scene_freq_mult_viz": false,
"edge_encoding": true,
"use_map_encoding": true,
"augment": false,
"override_attention_radius": []
}

File diff suppressed because one or more lines are too long

View file

@ -506,7 +506,9 @@ def decorate_frame(frame: Frame, tracker_frame: Frame, prediction_frame: Frame,
if prediction_frame.maps:
for i, m in enumerate(prediction_frame.maps):
map_img = np.ascontiguousarray(np.flipud(np.transpose(m[0], (2, 1, 0))*255), np.uint8)
cv2.circle(map_img, (10,50), 5, (255,0,0), 2)
cv2.circle(map_img, (10,50), 5, (0,255,0), 2)
cv2.line(map_img, (10,50), (10+15, 50), (0,0,255), 2)
cv2.rectangle(map_img, (0,0), (map_img.shape[1]-1, map_img.shape[0]-1), (255,255,255), 1)
height, width, _ = map_img.shape
padding= 50

View file

@ -200,7 +200,7 @@ def transition_path_points(path: np.array, t: float):
# distance = cum_lenghts[-1] * t
# ts = np.concatenate((np.array([0.]), cum_lenghts / cum_lenghts[-1]))
# print(cum_lenghts[-1])
DRAW_SPEED = 22 # fixed speed (independent of lenght) TODO)) make variable
DRAW_SPEED = 30 # fixed speed (independent of lenght) TODO)) make variable
ts = np.concatenate((np.array([0.]), cum_lenghts / DRAW_SPEED))
new_path = [path[0]]
@ -263,7 +263,7 @@ def draw_track_predictions(img: cv2.Mat, track: Track, color_index: int, camera:
# start = [int(p) for p in pred_coords[ci-1]]
# end = [int(p) for p in pred_coords[ci]]
# print(np.rint(start),np.rint(end).tolist())
cv2.line(img, start, end, color, 1, lineType=cv2.LINE_AA)
cv2.line(img, start, end, color, 2, lineType=cv2.LINE_AA)
pass
# cv2.circle(img, end, 2, color, 1, lineType=cv2.LINE_AA)

View file

@ -84,7 +84,7 @@ class ImageMap(GeometricMap): # TODO Implement for image maps -> watch flipped
img = img.astype(np.uint8)
# img = cv2.resize(img, (img.shape[1]//10, img.shape[0]//10))
img_reverse = img[::-1,:,:] # origin to bottom left, instead of top-left
layers = np.transpose(img_reverse, (2, 1, 0)) # array order: layers, x, y
layers = np.transpose(img, (2, 1, 0)) # array order: layers, x, y
layers = layers.copy() # copy to apply negative stride
# layers =