Skip to content

Commit

Permalink
Revert "require class_name for count mode detectors"
Browse files Browse the repository at this point in the history
This reverts commit 4ed9694.
  • Loading branch information
brandon-groundlight committed Dec 7, 2024
1 parent 4ed9694 commit 1bda6d3
Show file tree
Hide file tree
Showing 8 changed files with 453 additions and 503 deletions.
1 change: 0 additions & 1 deletion generated/docs/CountModeConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**max_count** | **int** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

Expand Down
4 changes: 1 addition & 3 deletions generated/docs/ImageQueriesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = image_queries_api.ImageQueriesApi(api_client)
detector_id = "detector_id_example" # str | Choose a detector by its ID.
confidence_threshold = 0 # float | The confidence threshold for the image query. (optional)
human_review = "human_review_example" # str | If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. (optional)
image_query_id = "image_query_id_example" # str | The ID to assign to the created image query. (optional)
inspection_id = "inspection_id_example" # str | Associate the image query with an inspection. (optional)
Expand All @@ -301,7 +300,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.submit_image_query(detector_id, confidence_threshold=confidence_threshold, human_review=human_review, image_query_id=image_query_id, inspection_id=inspection_id, metadata=metadata, patience_time=patience_time, want_async=want_async, body=body)
api_response = api_instance.submit_image_query(detector_id, human_review=human_review, image_query_id=image_query_id, inspection_id=inspection_id, metadata=metadata, patience_time=patience_time, want_async=want_async, body=body)
pprint(api_response)
except groundlight_openapi_client.ApiException as e:
print("Exception when calling ImageQueriesApi->submit_image_query: %s\n" % e)
Expand All @@ -313,7 +312,6 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**detector_id** | **str**| Choose a detector by its ID. |
**confidence_threshold** | **float**| The confidence threshold for the image query. | [optional]
**human_review** | **str**| If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. | [optional]
**image_query_id** | **str**| The ID to assign to the created image query. | [optional]
**inspection_id** | **str**| Associate the image query with an inspection. | [optional]
Expand Down
16 changes: 2 additions & 14 deletions generated/groundlight_openapi_client/api/image_queries_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def __init__(self, api_client=None):
params_map={
"all": [
"detector_id",
"confidence_threshold",
"human_review",
"image_query_id",
"inspection_id",
Expand All @@ -184,21 +183,13 @@ def __init__(self, api_client=None):
],
"nullable": [],
"enum": [],
"validation": [
"confidence_threshold",
],
"validation": [],
},
root_map={
"validations": {
("confidence_threshold",): {
"inclusive_maximum": 1,
"inclusive_minimum": 0,
},
},
"validations": {},
"allowed_values": {},
"openapi_types": {
"detector_id": (str,),
"confidence_threshold": (float,),
"human_review": (str,),
"image_query_id": (str,),
"inspection_id": (str,),
Expand All @@ -209,7 +200,6 @@ def __init__(self, api_client=None):
},
"attribute_map": {
"detector_id": "detector_id",
"confidence_threshold": "confidence_threshold",
"human_review": "human_review",
"image_query_id": "image_query_id",
"inspection_id": "inspection_id",
Expand All @@ -219,7 +209,6 @@ def __init__(self, api_client=None):
},
"location_map": {
"detector_id": "query",
"confidence_threshold": "query",
"human_review": "query",
"image_query_id": "query",
"inspection_id": "query",
Expand Down Expand Up @@ -432,7 +421,6 @@ def submit_image_query(self, detector_id, **kwargs):
detector_id (str): Choose a detector by its ID.
Keyword Args:
confidence_threshold (float): The confidence threshold for the image query.. [optional]
human_review (str): If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident.. [optional]
image_query_id (str): The ID to assign to the created image query.. [optional]
inspection_id (str): Associate the image query with an inspection.. [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def openapi_types():
and the value is attribute type.
"""
return {
"class_name": (str,), # noqa: E501
"max_count": (int,), # noqa: E501
}

Expand All @@ -102,7 +101,6 @@ def discriminator():
return None

attribute_map = {
"class_name": "class_name", # noqa: E501
"max_count": "max_count", # noqa: E501
}

Expand All @@ -112,12 +110,9 @@ def discriminator():

@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
"""CountModeConfiguration - a model defined in OpenAPI
Args:
class_name (str):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
Expand Down Expand Up @@ -178,7 +173,6 @@ def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.class_name = class_name
for var_name, var_value in kwargs.items():
if (
var_name not in self.attribute_map
Expand All @@ -201,12 +195,9 @@ def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
])

@convert_js_args_to_python_args
def __init__(self, class_name, *args, **kwargs): # noqa: E501
def __init__(self, *args, **kwargs): # noqa: E501
"""CountModeConfiguration - a model defined in OpenAPI
Args:
class_name (str):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
Expand Down Expand Up @@ -265,7 +256,6 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.class_name = class_name
for var_name, var_value in kwargs.items():
if (
var_name not in self.attribute_map
Expand Down
3 changes: 0 additions & 3 deletions generated/groundlight_openapi_client/model/counting_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ class CountingResult(ModelNormal):
}

validations = {
("count",): {
"inclusive_minimum": 0,
},
("confidence",): {
"inclusive_maximum": 1.0,
"inclusive_minimum": 0.0,
Expand Down
5 changes: 2 additions & 3 deletions generated/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: public-api.yaml
# timestamp: 2024-12-07T00:51:02+00:00
# timestamp: 2024-12-05T21:27:07+00:00

from __future__ import annotations

Expand Down Expand Up @@ -200,7 +200,7 @@ class BinaryClassificationResult(BaseModel):
class CountingResult(BaseModel):
confidence: Optional[confloat(ge=0.0, le=1.0)] = None
source: Optional[Source] = None
count: conint(ge=0)
count: int
greater_than_max: Optional[bool] = None


Expand All @@ -212,7 +212,6 @@ class MultiClassificationResult(BaseModel):

class CountModeConfiguration(BaseModel):
max_count: Optional[conint(ge=1, le=50)] = None
class_name: str


class MultiClassModeConfiguration(BaseModel):
Expand Down
Loading

0 comments on commit 1bda6d3

Please sign in to comment.