Skip to content

Commit 7fc9fec

Browse files
author
Diego Ardila
committed
Merge master and fix conflicts
2 parents eeac799 + eaa1e87 commit 7fc9fec

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

nucleus/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@
6767

6868
from .annotation import (
6969
BoxAnnotation,
70-
Point,
7170
PolygonAnnotation,
7271
Segment,
7372
SegmentationAnnotation,
73+
Point,
74+
CuboidAnnotation,
7475
)
7576
from .constants import (
7677
ANNOTATION_METADATA_SCHEMA_KEY,
@@ -118,6 +119,7 @@
118119
)
119120
from .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

nucleus/dataset.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
import requests
44

55
from nucleus.job import AsyncJob
6+
from nucleus.url_utils import sanitize_string_args
67
from 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+
)
1518
from .constants import (
1619
DATASET_ITEM_IDS_KEY,
1720
DATASET_LENGTH_KEY,
@@ -33,7 +36,6 @@
3336
)
3437
from .payload_constructor import construct_model_run_creation_payload
3538

36-
3739
WARN_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

0 commit comments

Comments
 (0)