From da6c18c0317ae0c5f5f634327b140954e39660b7 Mon Sep 17 00:00:00 2001 From: Drew Kaul Date: Mon, 28 Jun 2021 10:57:18 -0700 Subject: [PATCH] fix lint --- nucleus/__init__.py | 7 +++++++ nucleus/dataset.py | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nucleus/__init__.py b/nucleus/__init__.py index c4797bdb..9335d3d9 100644 --- a/nucleus/__init__.py +++ b/nucleus/__init__.py @@ -68,6 +68,7 @@ Segment, SegmentationAnnotation, Point, + CuboidAnnotation, ) from .constants import ( ANNOTATION_METADATA_SCHEMA_KEY, @@ -115,6 +116,7 @@ ) from .prediction import ( BoxPrediction, + CuboidPrediction, PolygonPrediction, SegmentationPrediction, ) @@ -565,6 +567,8 @@ def annotate_dataset( :param update: whether to update or ignore conflicting annotations :return: {"dataset_id: str, "annotations_processed": int} """ + if any((isinstance(ann, CuboidAnnotation) for ann in annotations)): + raise NotImplementedError("Cuboid annotations not yet supported") # Split payload into segmentations and Box/Polygon segmentations = [ @@ -723,6 +727,9 @@ def predict( "predictions_ignored": int, } """ + if any((isinstance(ann, CuboidPrediction) for ann in annotations)): + raise NotImplementedError("Cuboid predictions not yet supported") + segmentations = [ ann for ann in annotations diff --git a/nucleus/dataset.py b/nucleus/dataset.py index ac436ef3..2b7481c0 100644 --- a/nucleus/dataset.py +++ b/nucleus/dataset.py @@ -9,7 +9,11 @@ serialize_and_write_to_presigned_url, ) -from .annotation import Annotation, check_all_annotation_paths_remote +from .annotation import ( + Annotation, + CuboidAnnotation, + check_all_annotation_paths_remote, +) from .constants import ( DATASET_ITEM_IDS_KEY, DATASET_LENGTH_KEY, @@ -163,6 +167,9 @@ def annotate( "ignored_items": int, } """ + if any((isinstance(ann, CuboidAnnotation) for ann in annotations)): + raise NotImplementedError("Cuboid annotations not yet supported") + if asynchronous: check_all_annotation_paths_remote(annotations)