azure.cognitiveservices.vision.customvision.prediction package¶
Submodules¶
Module contents¶
-
class
azure.cognitiveservices.vision.customvision.prediction.
CustomVisionPredictionClient
(api_key, endpoint)[source]¶ Bases:
msrest.service_client.SDKClient
Variables: config (CustomVisionPredictionClientConfiguration) – Configuration for client.
Parameters: - api_key (str) – API key.
- endpoint (str) – Supported Cognitive Services endpoints.
-
classify_image
(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Classify an image and saves the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- image_data (Generator) – Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises:
-
classify_image_url
(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Classify an image url and saves the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- url (str) – Url of the image.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises:
-
classify_image_url_with_no_store
(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Classify an image url without saving the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- url (str) – Url of the image.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises:
-
classify_image_with_no_store
(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Classify an image without saving the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- image_data (Generator) – Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises:
-
detect_image
(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Detect objects in an image and saves the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- image_data (Generator) – Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises:
-
detect_image_url
(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Detect objects in an image url and saves the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- url (str) – Url of the image.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises:
-
detect_image_url_with_no_store
(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Detect objects in an image url without saving the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- url (str) – Url of the image.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises:
-
detect_image_with_no_store
(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)[source]¶ Detect objects in an image without saving the result.
Parameters: - project_id (str) – The project id.
- published_name (str) – Specifies the name of the model to evaluate against.
- image_data (Generator) – Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB.
- application (str) – Optional. Specifies the name of application using the endpoint.
- custom_headers (dict) – headers that will be added to the request
- raw (bool) – returns the direct response alongside the deserialized response
- operation_config – Operation configuration overrides.
Returns: ImagePrediction or ClientRawResponse if raw=true
Return type: ImagePrediction or ClientRawResponse
Raises: