File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 6767
6868from .annotation import (
6969 BoxAnnotation ,
70- Point ,
7170 PolygonAnnotation ,
7271 Segment ,
7372 SegmentationAnnotation ,
73+ Point ,
74+ CuboidAnnotation ,
7475)
7576from .constants import (
7677 ANNOTATION_METADATA_SCHEMA_KEY ,
118119)
119120from .prediction import (
120121 BoxPrediction ,
122+ CuboidPrediction ,
121123 PolygonPrediction ,
122124 SegmentationPrediction ,
123125)
@@ -569,6 +571,8 @@ def annotate_dataset(
569571 :param update: whether to update or ignore conflicting annotations
570572 :return: {"dataset_id: str, "annotations_processed": int}
571573 """
574+ if any ((isinstance (ann , CuboidAnnotation ) for ann in annotations )):
575+ raise NotImplementedError ("Cuboid annotations not yet supported" )
572576
573577 # Split payload into segmentations and Box/Polygon
574578 segmentations = [
@@ -727,6 +731,9 @@ def predict(
727731 "predictions_ignored": int,
728732 }
729733 """
734+ if any ((isinstance (ann , CuboidPrediction ) for ann in annotations )):
735+ raise NotImplementedError ("Cuboid predictions not yet supported" )
736+
730737 segmentations = [
731738 ann
732739 for ann in annotations
Original file line number Diff line number Diff line change 33import requests
44
55from nucleus .job import AsyncJob
6+ from nucleus .url_utils import sanitize_string_args
67from nucleus .utils import (
78 convert_export_payload ,
89 format_dataset_item_response ,
910 serialize_and_write_to_presigned_url ,
1011)
1112
12- from nucleus .url_utils import sanitize_string_args
13-
14- from .annotation import Annotation , check_all_annotation_paths_remote
13+ from .annotation import (
14+ Annotation ,
15+ CuboidAnnotation ,
16+ check_all_annotation_paths_remote ,
17+ )
1518from .constants import (
1619 DATASET_ITEM_IDS_KEY ,
1720 DATASET_LENGTH_KEY ,
3336)
3437from .payload_constructor import construct_model_run_creation_payload
3538
36-
3739WARN_FOR_LARGE_UPLOAD = 50000
3840
3941
@@ -166,6 +168,9 @@ def annotate(
166168 "ignored_items": int,
167169 }
168170 """
171+ if any ((isinstance (ann , CuboidAnnotation ) for ann in annotations )):
172+ raise NotImplementedError ("Cuboid annotations not yet supported" )
173+
169174 if asynchronous :
170175 check_all_annotation_paths_remote (annotations )
171176
You can’t perform that action at this time.
0 commit comments