你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
CustomVisionPredictionClient Class
- Inheritance
-
azure.cognitiveservices.vision.customvision.prediction.operations._custom_vision_prediction_client_operations.CustomVisionPredictionClientOperationsMixinCustomVisionPredictionClientmsrest.service_client.SDKClientCustomVisionPredictionClient
Constructor
CustomVisionPredictionClient(endpoint, credentials)
Parameters
Name | Description |
---|---|
endpoint
Required
|
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
|
The project id. |
published_name
Required
|
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
|
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
|
The project id. |
published_name
Required
|
Specifies the name of the model to evaluate against. |
url
Required
|
Url of the image. |
application
|
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
|
The project id. |
published_name
Required
|
Specifies the name of the model to evaluate against. |
url
Required
|
Url of the image. |
application
|
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
|
The project id. |
published_name
Required
|
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
|
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
|
The project id. |
published_name
Required
|
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
|
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
|
The project id. |
published_name
Required
|
Specifies the name of the model to evaluate against. |
url
Required
|
Url of the image. |
application
|
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
|
The project id. |
published_name
Required
|
Specifies the name of the model to evaluate against. |
url
Required
|
Url of the image. |
application
|
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
|
The project id. |
published_name
Required
|
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
|
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 |
---|---|