azure.cognitiveservices.vision.customvision.prediction.operations module

class azure.cognitiveservices.vision.customvision.prediction.operations.CustomVisionPredictionClientOperationsMixin[source]

Bases: object

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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException

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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException

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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException

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 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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException

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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException

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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException

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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException

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 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_configOperation configuration overrides.

Returns

ImagePrediction or ClientRawResponse if raw=true

Return type

ImagePrediction or ClientRawResponse

Raises

CustomVisionErrorException