From 2c102561969431585c6b286bfd5f9aa747a2ab71 Mon Sep 17 00:00:00 2001 From: VlSomers Date: Fri, 9 Feb 2024 09:22:39 +0000 Subject: [PATCH] deploy: 212ee10c5e9031db0eb93eac5b283d46bc45818a --- .../wrappers/datasets/soccernet/soccernet_mot.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/_modules/tracklab/wrappers/datasets/soccernet/soccernet_mot.html b/_modules/tracklab/wrappers/datasets/soccernet/soccernet_mot.html index 0db61bad..927720ff 100644 --- a/_modules/tracklab/wrappers/datasets/soccernet/soccernet_mot.html +++ b/_modules/tracklab/wrappers/datasets/soccernet/soccernet_mot.html @@ -308,13 +308,15 @@

Source code for tracklab.wrappers.datasets.soccernet.soccernet_mot

image_metadata = pd.concat(image_metadata_list, ignore_index=True) detections = pd.concat(detections_list, ignore_index=True) + # Sort to obtain deterministic ids and index + detections = detections.sort_values(by=['video_id', 'image_id', 'track_id'], ascending=[True, True, True]) + detections = detections.reset_index(drop=True) + detections['id'] = detections.index + # Add category id to detections category_to_id = {category['name']: category['id'] for category in categories_list} detections['category_id'] = detections['category'].apply(lambda x: category_to_id[x]) - # Set 'id' column as the index in the detections and image dataframe - detections['id'] = detections.index - detections.set_index("id", drop=False, inplace=True) image_metadata.set_index("id", drop=False, inplace=True) video_metadata.set_index("id", drop=False, inplace=True)