You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After opening the labelstudio project, the first issue is that it seems that the predictions for samples with the classification label is set properly, but other samples have null predictions which may be causing some errors loading the samples in the labelstudio app.
Ex:
Then when going to label all tasks, the existing classification is not selected as it should be (this seems to also occur with detections, so this part may be expected):
Then after labeling a subset of the samples and going to load annotations in FiftyOne, this error message is raised:
File ~/work/fiftyone/fiftyone/fiftyone/core/collections.py:9016, in SampleCollection.load_annotations(self, anno_key, dest_field, unexpected, cleanup, progress, **kwargs)
8971 def load_annotations(
8972 self,
8973 anno_key,
(...)
8978 **kwargs,
8979 ):
8980 """Downloads the labels from the given annotation run from the
8981 annotation backend and merges them into this collection.
8982
(...)
9014 found, in which case a dict containing the extra labels is returned
9015 """
-> 9016 return foua.load_annotations(
9017 self,
9018 anno_key,
9019 dest_field=dest_field,
9020 unexpected=unexpected,
9021 cleanup=cleanup,
9022 progress=progress,
9023 **kwargs,
9024 )
File ~/work/fiftyone/fiftyone/fiftyone/utils/annotations.py:1038, in load_annotations(samples, anno_key, dest_field, unexpected, cleanup, progress, **kwargs)
1036 dataset = samples._root_dataset
1037 results = dataset.load_annotation_results(anno_key, **kwargs)
-> 1038 annotations = results.backend.download_annotations(results)
1039 label_schema = results.config.label_schema
1040 is_clips_view = results._is_clips
File ~/work/fiftyone/fiftyone/fiftyone/utils/labelstudio.py:158, in LabelStudioBackend.download_annotations(self, results)
155 api = self.connect_to_api()
157 logger.info("Downloading labels from Label Studio...")
--> 158 annotations = api.download_annotations(results)
159 logger.info("Download complete")
161 return annotations
File ~/work/fiftyone/fiftyone/fiftyone/utils/labelstudio.py:486, in LabelStudioAnnotationAPI.download_annotations(self, results)
482 labeled_tasks = self._get_matched_labeled_tasks(
483 project, list(results.uploaded_tasks.keys())
484 )
485 annotations = {}
--> 486 all_labels = self._import_annotations(
487 labeled_tasks, results.uploaded_tasks
488 )
489 annotations = defaultdict(lambda: defaultdict(dict))
490 for task_id, task_labels in all_labels.items():
File ~/work/fiftyone/fiftyone/fiftyone/utils/labelstudio.py:407, in LabelStudioAnnotationAPI._import_annotations(self, tasks, task_map)
401 result_kps = [
402 r for r in latest_result if _result_type(r) == "keypointlabels"
403 ]
404 result_not_kps = [
405 r for r in latest_result if _result_type(r) != "keypointlabels"
406 ]
--> 407 labels = [
408 import_label_studio_annotation(r) for r in result_not_kps
409 ]
410 if result_kps:
411 labels += [import_label_studio_annotation(result_kps)]
File ~/work/fiftyone/fiftyone/fiftyone/utils/labelstudio.py:408, in <listcomp>(.0)
401 result_kps = [
402 r for r in latest_result if _result_type(r) == "keypointlabels"
403 ]
404 result_not_kps = [
405 r for r in latest_result if _result_type(r) != "keypointlabels"
406 ]
407 labels = [
--> 408 import_label_studio_annotation(r) for r in result_not_kps
409 ]
410 if result_kps:
411 labels += [import_label_studio_annotation(result_kps)]
File ~/work/fiftyone/fiftyone/fiftyone/utils/labelstudio.py:672, in import_label_studio_annotation(result)
670 label = _from_number(result)
671 else:
--> 672 raise ValueError("Unable to import %s from Label Studio" % ls_type)
674 try:
675 label_id = result["id"]
ValueError: Unable to import None from Label Studio
System information
OS Platform and Distribution (e.g., Linux Ubuntu 22.04): ubuntu 22.04
Python version (python --version): 3.10.13
FiftyOne version (fiftyone --version): 0.25.0
FiftyOne installed from (pip or source): source
The text was updated successfully, but these errors were encountered:
Describe the problem
As mentioned here: #4725 (review)
There seem to be bugs when working with existing Classification and now Classifications fields that are uploaded to labelstudio.
Code to reproduce issue
null
predictions which may be causing some errors loading the samples in the labelstudio app.Ex:
Then when going to label all tasks, the existing classification is not selected as it should be (this seems to also occur with detections, so this part may be expected):
Then after labeling a subset of the samples and going to load annotations in FiftyOne, this error message is raised:
System information
python --version
): 3.10.13fiftyone --version
): 0.25.0The text was updated successfully, but these errors were encountered: