diff --git a/src/groundlight/client.py b/src/groundlight/client.py index 4da9651e..aaa54b8b 100644 --- a/src/groundlight/client.py +++ b/src/groundlight/client.py @@ -1069,7 +1069,10 @@ def _wait_for_result( return image_query def add_label( - self, image_query: Union[ImageQuery, str], label: Union[Label, int, str], rois: Union[List[ROI], str, None] = None + self, + image_query: Union[ImageQuery, str], + label: Union[Label, int, str], + rois: Union[List[ROI], str, None] = None, ): """ Provide a new label (annotation) for an image query. This is used to provide ground-truth labels diff --git a/src/groundlight/experimental_api.py b/src/groundlight/experimental_api.py index 1a8c34cd..56d48a1d 100644 --- a/src/groundlight/experimental_api.py +++ b/src/groundlight/experimental_api.py @@ -17,22 +17,18 @@ from groundlight_openapi_client.api.image_queries_api import ImageQueriesApi from groundlight_openapi_client.api.notes_api import NotesApi from groundlight_openapi_client.model.action_request import ActionRequest -from groundlight_openapi_client.model.b_box_geometry_request import BBoxGeometryRequest from groundlight_openapi_client.model.channel_enum import ChannelEnum from groundlight_openapi_client.model.condition_request import ConditionRequest from groundlight_openapi_client.model.count_mode_configuration import CountModeConfiguration from groundlight_openapi_client.model.detector_group_request import DetectorGroupRequest from groundlight_openapi_client.model.escalation_type_enum import EscalationTypeEnum -from groundlight_openapi_client.model.label_value_request import LabelValueRequest from groundlight_openapi_client.model.multi_class_mode_configuration import MultiClassModeConfiguration from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest -from groundlight_openapi_client.model.roi_request import ROIRequest from groundlight_openapi_client.model.rule_request import RuleRequest from groundlight_openapi_client.model.status_enum import StatusEnum from groundlight_openapi_client.model.verb_enum import VerbEnum -from model import ROI, BBoxGeometry, Detector, DetectorGroup, ImageQuery, ModeEnum, PaginatedRuleList, Rule +from model import ROI, BBoxGeometry, Detector, DetectorGroup, ModeEnum, PaginatedRuleList, Rule -from groundlight.binary_labels import Label from groundlight.images import parse_supported_image_types from groundlight.optional_imports import Image, np diff --git a/test/unit/test_labels.py b/test/unit/test_labels.py index 474c6ae0..a2e3c37e 100644 --- a/test/unit/test_labels.py +++ b/test/unit/test_labels.py @@ -1,7 +1,7 @@ from datetime import datetime import pytest -from groundlight import ExperimentalApi, ApiException +from groundlight import ApiException, ExperimentalApi def test_binary_labels(gl_experimental: ExperimentalApi): @@ -20,6 +20,7 @@ def test_binary_labels(gl_experimental: ExperimentalApi): with pytest.raises(ApiException) as _: gl_experimental.add_label(iq1, "MAYBE") + def test_counting_labels(gl_experimental: ExperimentalApi): name = f"Test binary labels{datetime.utcnow()}" det = gl_experimental.create_counting_detector(name, "test_query") @@ -35,6 +36,7 @@ def test_counting_labels(gl_experimental: ExperimentalApi): with pytest.raises(ApiException) as _: gl_experimental.add_label(iq1, -999) + def test_multiclass_labels(gl_experimental: ExperimentalApi): name = f"Test binary labels{datetime.utcnow()}" det = gl_experimental.create_multiclass_detector(name, "test_query", class_names=["apple", "banana", "cherry"])