다음을 통해 공유


ImageModerationOperations Class

ImageModerationOperations operations.

Inheritance
builtins.object
ImageModerationOperations

Constructor

ImageModerationOperations(client, config, serializer, deserializer)

Parameters

Name Description
client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Methods

evaluate_file_input

Returns probabilities of the image containing racy or adult content.

evaluate_method

Returns probabilities of the image containing racy or adult content.

evaluate_url_input

Returns probabilities of the image containing racy or adult content.

find_faces

Returns the list of faces found.

find_faces_file_input

Returns the list of faces found.

find_faces_url_input

Returns the list of faces found.

match_file_input

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using this API. Returns ID and tags of matching image.

Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

match_method

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using this API. Returns ID and tags of matching image.

Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

match_url_input

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using this API. Returns ID and tags of matching image.

Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

ocr_file_input

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

ocr_method

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

ocr_url_input

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

evaluate_file_input

Returns probabilities of the image containing racy or adult content.

evaluate_file_input(image_stream, cache_image=None, custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

Name Description
image_stream
Required

The image file.

cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

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
callback
Callable[<xref:Bytes>, <xref:response=None>]

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

Default value: None
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

Evaluate or ClientRawResponse if raw=true

Exceptions

Type Description

evaluate_method

Returns probabilities of the image containing racy or adult content.

evaluate_method(cache_image=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

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>

Evaluate or ClientRawResponse if raw=true

Exceptions

Type Description

evaluate_url_input

Returns probabilities of the image containing racy or adult content.

evaluate_url_input(content_type, cache_image=None, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
content_type
Required
str

The content type.

cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

Default value: None
data_representation
str
Default value: URL
value
str
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>

Evaluate or ClientRawResponse if raw=true

Exceptions

Type Description

find_faces

Returns the list of faces found.

find_faces(cache_image=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

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>

FoundFaces or ClientRawResponse if raw=true

Exceptions

Type Description

find_faces_file_input

Returns the list of faces found.

find_faces_file_input(image_stream, cache_image=None, custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

Name Description
image_stream
Required

The image file.

cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

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
callback
Callable[<xref:Bytes>, <xref:response=None>]

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

Default value: None
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

FoundFaces or ClientRawResponse if raw=true

Exceptions

Type Description

find_faces_url_input

Returns the list of faces found.

find_faces_url_input(content_type, cache_image=None, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
content_type
Required
str

The content type.

cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

Default value: None
data_representation
str
Default value: URL
value
str
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>

FoundFaces or ClientRawResponse if raw=true

Exceptions

Type Description

match_file_input

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using this API. Returns ID and tags of matching image.

Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

match_file_input(image_stream, list_id=None, cache_image=None, custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

Name Description
image_stream
Required

The image file.

list_id
str

The list Id.

Default value: None
cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

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
callback
Callable[<xref:Bytes>, <xref:response=None>]

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

Default value: None
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

MatchResponse or ClientRawResponse if raw=true

Exceptions

Type Description

match_method

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using this API. Returns ID and tags of matching image.

Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

match_method(list_id=None, cache_image=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
list_id
str

The list Id.

Default value: None
cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

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>

MatchResponse or ClientRawResponse if raw=true

Exceptions

Type Description

match_url_input

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using this API. Returns ID and tags of matching image.

Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

match_url_input(content_type, list_id=None, cache_image=None, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
content_type
Required
str

The content type.

list_id
str

The list Id.

Default value: None
cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

Default value: None
data_representation
str
Default value: URL
value
str
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>

MatchResponse or ClientRawResponse if raw=true

Exceptions

Type Description

ocr_file_input

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

ocr_file_input(language, image_stream, cache_image=None, enhanced=False, custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

Name Description
language
Required
str

Language of the terms.

image_stream
Required

The image file.

cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

Default value: None
enhanced

When set to True, the image goes through additional processing to come with additional candidates. image/tiff is not supported when enhanced is set to true Note: This impacts the response time.

Default value: False
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
callback
Callable[<xref:Bytes>, <xref:response=None>]

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

Default value: None
operation_config
Required

Operation configuration overrides.

Returns

Type Description
OCR,
<xref:msrest.pipeline.ClientRawResponse>

OCR or ClientRawResponse if raw=true

Exceptions

Type Description

ocr_method

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

ocr_method(language, cache_image=None, enhanced=False, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
language
Required
str

Language of the terms.

cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

Default value: None
enhanced

When set to True, the image goes through additional processing to come with additional candidates. image/tiff is not supported when enhanced is set to true Note: This impacts the response time.

Default value: False
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
OCR,
<xref:msrest.pipeline.ClientRawResponse>

OCR or ClientRawResponse if raw=true

Exceptions

Type Description

ocr_url_input

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

ocr_url_input(language, content_type, cache_image=None, enhanced=False, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
language
Required
str

Language of the terms.

content_type
Required
str

The content type.

cache_image

Whether to retain the submitted image for future use; defaults to false if omitted.

Default value: None
enhanced

When set to True, the image goes through additional processing to come with additional candidates. image/tiff is not supported when enhanced is set to true Note: This impacts the response time.

Default value: False
data_representation
str
Default value: URL
value
str
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
OCR,
<xref:msrest.pipeline.ClientRawResponse>

OCR or ClientRawResponse if raw=true

Exceptions

Type Description

Attributes

models

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\cognitiveservices\\vision\\contentmoderator\\models\\__init__.py'>