def _index_instance_tokens(self):
        """Index instance tokens for uniquely identifying instances across samples"""
        instance_token_to_id = {}
        for record in self.nusc.sample_annotation:
            instance_token = record['instance_token']
            if instance_token not in instance_token_to_id:
                next_instance_id = len(instance_token_to_id)
                instance_token_to_id[instance_token] = next_instance_id
        return instance_token_to_id
Index instance tokens for uniquely identifying instances across samples
tridet/data/datasets/nuscenes/build.py