azure.cognitiveservices.vision.customvision.prediction package

Module contents

class azure.cognitiveservices.vision.customvision.prediction.PredictionEndpoint(api_key, base_url=None)[source]

Bases: msrest.service_client.SDKClient

Variables:

config (PredictionEndpointConfiguration) – Configuration for client.

Parameters:
  • api_key (str) –
  • base_url (str) – Service URL
predict_image(project_id, image_data, iteration_id=None, application=None, custom_headers=None, raw=False, **operation_config)[source]

Predict an image and saves the result.

Parameters:
  • project_id (str) – The project id
  • image_data (Generator) –
  • iteration_id (str) – Optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified
  • 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:

HttpOperationError

predict_image_url(project_id, iteration_id=None, application=None, url=None, custom_headers=None, raw=False, **operation_config)[source]

Predict an image url and saves the result.

Parameters:
  • project_id (str) – The project id
  • iteration_id (str) – Optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified
  • application (str) – Optional. Specifies the name of application using the endpoint
  • url (str) –
  • 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:

HttpOperationError

predict_image_url_with_no_store(project_id, iteration_id=None, application=None, url=None, custom_headers=None, raw=False, **operation_config)[source]

Predict an image url without saving the result.

Parameters:
  • project_id (str) – The project id
  • iteration_id (str) – Optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified
  • application (str) – Optional. Specifies the name of application using the endpoint
  • url (str) –
  • 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:

HttpOperationError

predict_image_with_no_store(project_id, image_data, iteration_id=None, application=None, custom_headers=None, raw=False, **operation_config)[source]

Predict an image without saving the result.

Parameters:
  • project_id (str) – The project id
  • image_data (Generator) –
  • iteration_id (str) – Optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified
  • 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:

HttpOperationError