def _finalize_id_map(self):
        """Internal method that is (only) called prior to saving annotation
        results for the first time.
        """
        if self.samples._is_clips:
            id_map = dict(zip(*self.samples.values(["id", "sample_id"])))
            self.id_map["_clips"] = id_map

        if self.samples._is_frames:
            id_map = dict(zip(*self.samples.values(["id", "sample_id"])))
            self.id_map["_frames"] = id_map
Internal method that is (only) called prior to saving annotation
        results for the first time.
        
fiftyone/utils/annotations.py