ZikangZhou/HiVT

HiVT map-free customization

Closed this issue · 1 comments

Hello, first of all, thank you for your excellent work and dedication in making it openly available for the community to use.

I was wondering how I could adapt your code so that it can be evaluated in a version without a map, as they claim in the following paper. They have compared HiVT with your model in a way that doesn't use a map.

Thanks in advance

I believe the author(s) have moved on to their new algorithm QCNet and such won't really put too much work into this one anymore.

I believe to make it work without map all you need to do is remove the ALEncoder in local_encoder.py :

self.al_encoder = ALEncoder(node_dim=node_dim,
edge_dim=edge_dim,
embed_dim=embed_dim,
num_heads=num_heads,
dropout=dropout)

edge_index, edge_attr = self.drop_edge(data['lane_actor_index'], data['lane_actor_vectors'])
out = self.al_encoder(x=(data['lane_vectors'], out), edge_index=edge_index, edge_attr=edge_attr,
is_intersections=data['is_intersections'], turn_directions=data['turn_directions'],
traffic_controls=data['traffic_controls'], rotate_mat=data['rotate_mat'])

You can also remove the mapping sections from the data preprocessing if you are using Argoverse:

# get lane features at the current time step
df_19 = df[df['TIMESTAMP'] == timestamps[19]]
node_inds_19 = [actor_ids.index(actor_id) for actor_id in df_19['TRACK_ID']]
node_positions_19 = torch.from_numpy(np.stack([df_19['X'].values, df_19['Y'].values], axis=-1)).float()
(lane_vectors, is_intersections, turn_directions, traffic_controls, lane_actor_index,
lane_actor_vectors) = get_lane_features(am, node_inds_19, node_positions_19, origin, rotate_mat, city, radius)

With this you should be able to run the code without map information, though I cannot say if this is the best way as to get optimal results.