Hello ScenarioNet team!Thank you for your great work!
I am interested in the Visualization of Scenario Embeddings with Scenario Generation Model (4.2 section in your paper) and noticed that you had processed some PG data based on TrafficGen, as noted in Appendix A.
However, when I tried to convert data exported from MetaDriveEnv and ScenarioEnv into the input vector v for Encoder, I found some format mismatches between data and processing scripts (Maybe because of the update in ScenarioNet scenario format?).
Would you please explain the meaning of the strings like "('>', '>>', 0)__0" , "('->>>', '->>', 2)", "('>>>', '1X20', 0)"
And do you have a script for converting the new format scenario data to vector v?
If not, would you please give me some advice on how to modify the convert script now (I use trafficgen/utils/get_md_data.py currently)?
Thanks again for your great work! Looking foward to your replay! (This problem really bothers me recently.)
The details are as follows:
I tried to convert scenario data with _trafficgen/utils/get_mddata.py
However, in __extractmap method, I found that _map_featsid in the following line 33, is a string"('>', '>>', 0)", therefore I modified a few to let the code run.
def _extract_map(map_feats, sample_num):
lanes = []
center_infos = {}
for map_feat_id, map_feat in map_feats.items():
if map_feat["type"] == "DRIVEWAY":
# TODO: The driveway is not supported in the current version of TrafficGen.
continue
if "polyline" not in map_feat:
if "polygon" in map_feat:
map_feat['polyline'] = map_feat['polygon'] #[np.newaxis]
else:
map_feat['polyline'] = map_feat['position'][np.newaxis]
poly_unsampled = map_feat['polyline'][:, :2]
# TODO(PZH): Revisit the down sampling function. It seems quite werid to me.
poly = _down_sampling(poly_unsampled, sample_num=sample_num)
a_lane = np.zeros([len(poly), 4], dtype=object)
# try:
# a_lane_id = str(map_feat_id[-2]) # ('>', '>>', 0)
# except:
# a_lane_id = str(map_feat_id[-4]) # ('>', '>>', 0)_0
a_lane[:, :2] = np.array(poly)
a_lane[:, 2] = METADRIVE_TYPE_TO_INT[map_feat['type']]
a_lane[:, 3] = map_feat_id #"('>', '>>', 0)" original str(map_feat_id)
lanes.append(a_lane)
if "LANE" in map_feat["type"]:
center_info = extract_center(map_feat)
center_infos[map_feat_id] = center_info #center_infos[str(map_feat_id)]
But input data didn't contain ["left_boundaries"] or ["right_boundaries"].
When it went into _extractneighbors method, I found that fb was only a list like: ["('>', '>>', 1)", "('>', '>>', 2)"]
but not a dict list required in the following method.
def extract_neighbors(fb):
nbs = []
for k in range(len(fb)):
nb = dict()
nb['id'] = fb[k]["feature_id"]
nb['indexes'] = [
fb[k]["self_start_index"], fb[k]["self_end_index"], fb[k]["neighbor_start_index"], fb[k]["neighbor_end_index"]
]
nb['indexes'] = [
fb[k]["self_start_index"], fb[k]["self_end_index"], fb[k]["neighbor_start_index"], fb[k]["neighbor_end_index"]
]
nb['boundaries'] = extract_boundaries(fb[k]["boundaries"])
nb['id'] = fb[k]["feature_id"]
nbs.append(nb)
return nbs
Scenario data was exported with _base_env.exportscenarios. Envs were defined as follows:
Hello ScenarioNet team!Thank you for your great work!
I am interested in the Visualization of Scenario Embeddings with Scenario Generation Model (4.2 section in your paper) and noticed that you had processed some PG data based on TrafficGen, as noted in Appendix A.
However, when I tried to convert data exported from MetaDriveEnv and ScenarioEnv into the input vector v for Encoder, I found some format mismatches between data and processing scripts (Maybe because of the update in ScenarioNet scenario format?).
Would you please explain the meaning of the strings like "('>', '>>', 0)__0" , "('->>>', '->>', 2)", "('>>>', '1X20', 0)"
And do you have a script for converting the new format scenario data to vector v?
If not, would you please give me some advice on how to modify the convert script now (I use trafficgen/utils/get_md_data.py currently)?
Thanks again for your great work! Looking foward to your replay! (This problem really bothers me recently.)
The details are as follows: I tried to convert scenario data with _trafficgen/utils/get_mddata.py However, in __extractmap method, I found that _map_featsid in the following line 33, is a string"('>', '>>', 0)", therefore I modified a few to let the code run.
extract_center
But input data didn't contain ["left_boundaries"] or ["right_boundaries"].
When it went into _extractneighbors method, I found that fb was only a list like: ["('>', '>>', 1)", "('>', '>>', 2)"] but not a dict list required in the following method.
Scenario data was exported with _base_env.exportscenarios. Envs were defined as follows:
I first exported data from metadriveEnv. Then I saved ScnearioEnv data by replaying scenario from metadrive dataset above in ScnearioEnv.