Make sure trajectories are sorted before preparing them for Python

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-07-25 13:30:01 +02:00
parent 4a4c23a66e
commit 8c31794aad

View File

@ -605,10 +605,11 @@ def prepare_scenenet_data(data_path: str, protobuf_path: str) -> Tuple[List[List
with open(protobuf_path, 'rb') as file:
trajectories.ParseFromString(file.read())
sorted_trajectories = sorted(trajectories.trajectories, key=lambda k: k.render_path)
file_names_photos = []
file_names_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}"
file_names_photos_traj = []
file_names_instances_traj = []