Compartir a través de


CustomVisionPredictionClient Class

Inheritance
azure.cognitiveservices.vision.customvision.prediction.operations._custom_vision_prediction_client_operations.CustomVisionPredictionClientOperationsMixin
CustomVisionPredictionClient
msrest.service_client.SDKClient
CustomVisionPredictionClient

Constructor

CustomVisionPredictionClient(endpoint, credentials)

Parameters

Name Description
endpoint
Required
str

Supported Cognitive Services endpoints.

credentials
Required

Subscription credentials which uniquely identify client subscription.

Variables

Name Description
config

Configuration for client.

Methods

classify_image

Classify an image and saves the result.

classify_image_url

Classify an image url and saves the result.

classify_image_url_with_no_store

Classify an image url without saving the result.

classify_image_with_no_store

Classify an image without saving the result.

close

Close the client if keep_alive is True.

detect_image

Detect objects in an image and saves the result.

detect_image_url

Detect objects in an image url and saves the result.

detect_image_url_with_no_store

Detect objects in an image url without saving the result.

detect_image_with_no_store

Detect objects in an image without saving the result.

classify_image

Classify an image and saves the result.

classify_image(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

image_data
Required

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.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description

classify_image_url

Classify an image url and saves the result.

classify_image_url(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

url
Required
str

Url of the image.

application
str

Optional. Specifies the name of application using the endpoint.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description

classify_image_url_with_no_store

Classify an image url without saving the result.

classify_image_url_with_no_store(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

url
Required
str

Url of the image.

application
str

Optional. Specifies the name of application using the endpoint.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description

classify_image_with_no_store

Classify an image without saving the result.

classify_image_with_no_store(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

image_data
Required

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.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description

close

Close the client if keep_alive is True.

close() -> None

Exceptions

Type Description

detect_image

Detect objects in an image and saves the result.

detect_image(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

image_data
Required

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.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description

detect_image_url

Detect objects in an image url and saves the result.

detect_image_url(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

url
Required
str

Url of the image.

application
str

Optional. Specifies the name of application using the endpoint.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description

detect_image_url_with_no_store

Detect objects in an image url without saving the result.

detect_image_url_with_no_store(project_id, published_name, url, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

url
Required
str

Url of the image.

application
str

Optional. Specifies the name of application using the endpoint.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description

detect_image_with_no_store

Detect objects in an image without saving the result.

detect_image_with_no_store(project_id, published_name, image_data, application=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
project_id
Required
str

The project id.

published_name
Required
str

Specifies the name of the model to evaluate against.

image_data
Required

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.

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ImagePrediction or ClientRawResponse if raw=true

Exceptions

Type Description