Skip to content

Commit

Permalink
Merge master and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Ardila committed Jun 28, 2021
2 parents eeac799 + eaa1e87 commit 7fc9fec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 8 additions & 1 deletion nucleus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@

from .annotation import (
BoxAnnotation,
Point,
PolygonAnnotation,
Segment,
SegmentationAnnotation,
Point,
CuboidAnnotation,
)
from .constants import (
ANNOTATION_METADATA_SCHEMA_KEY,
Expand Down Expand Up @@ -118,6 +119,7 @@
)
from .prediction import (
BoxPrediction,
CuboidPrediction,
PolygonPrediction,
SegmentationPrediction,
)
Expand Down Expand Up @@ -569,6 +571,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 = [
Expand Down Expand Up @@ -727,6 +731,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
Expand Down
13 changes: 9 additions & 4 deletions nucleus/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
import requests

from nucleus.job import AsyncJob
from nucleus.url_utils import sanitize_string_args
from nucleus.utils import (
convert_export_payload,
format_dataset_item_response,
serialize_and_write_to_presigned_url,
)

from nucleus.url_utils import sanitize_string_args

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,
Expand All @@ -33,7 +36,6 @@
)
from .payload_constructor import construct_model_run_creation_payload


WARN_FOR_LARGE_UPLOAD = 50000


Expand Down Expand Up @@ -166,6 +168,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)

Expand Down

0 comments on commit 7fc9fec

Please sign in to comment.