Make sure trajectories are sorted before preparing them for Python
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -605,10 +605,11 @@ def prepare_scenenet_data(data_path: str, protobuf_path: str) -> Tuple[List[List
|
|||||||
with open(protobuf_path, 'rb') as file:
|
with open(protobuf_path, 'rb') as file:
|
||||||
trajectories.ParseFromString(file.read())
|
trajectories.ParseFromString(file.read())
|
||||||
|
|
||||||
|
sorted_trajectories = sorted(trajectories.trajectories, key=lambda k: k.render_path)
|
||||||
file_names_photos = []
|
file_names_photos = []
|
||||||
file_names_instances = []
|
file_names_instances = []
|
||||||
instances = []
|
instances = []
|
||||||
for trajectory in tqdm.tqdm(trajectories.trajectories, desc="preparing trajectories"):
|
for trajectory in tqdm.tqdm(sorted_trajectories, desc="preparing trajectories"):
|
||||||
path = f"{data_path}/{trajectory.render_path}"
|
path = f"{data_path}/{trajectory.render_path}"
|
||||||
file_names_photos_traj = []
|
file_names_photos_traj = []
|
||||||
file_names_instances_traj = []
|
file_names_instances_traj = []
|
||||||
|
|||||||
Reference in New Issue
Block a user