def download_annotations(self, results):
        """Downloads the annotations from the Label Studio server for the given
        results instance and parses them into the appropriate FiftyOne types.

        Args:
            results: a :class:`LabelStudioAnnotationResults`

        Returns:
            the annotations dict
        """
        project = self._client.get_project(results.project_id)
        labeled_tasks = self._get_matched_labeled_tasks(
            project, list(results.uploaded_tasks.keys())
        )
        annotations = {}
        all_labels = self._import_annotations(
            labeled_tasks, results.uploaded_tasks
        )
        annotations = defaultdict(lambda: defaultdict(dict))
        for task_id, task_labels in all_labels.items():
            for label_id, (label_field, label) in task_labels.items():
                annotations[label_field][task_id][label_id] = label

        # convert to expected format
        final_annotations = {}
        for label_field, label_info in results.config.label_schema.items():
            return_type = foua._RETURN_TYPES_MAP[label_info["type"]]
            # need to convert masks to detections
            if label_info["type"] == "instances":
                new_label_field = defaultdict(dict)
                for task_id, task_labels in annotations[label_field].items():
                    for label_id, label in task_labels.items():
                        detections = label.to_detections(
                            {255: label.label}
                        ).detections
                        detections = detections[0] if detections else None
                        new_label_field[task_id][label_id] = detections
                annotations[label_field] = new_label_field
            final_annotations[label_field] = {
                return_type: annotations[label_field]
            }

        return final_annotations
Downloads the annotations from the Label Studio server for the given
        results instance and parses them into the appropriate FiftyOne types.

        Args:
            results: a :class:`LabelStudioAnnotationResults`

        Returns:
            the annotations dict
        
fiftyone/utils/labelstudio.py