ImageModerationOperations Class

ImageModerationOperations operations.

Inheritance
builtins.object
ImageModerationOperations

Constructor

ImageModerationOperations(client, config, serializer, deserializer)

Parameters

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

image_stream
<xref:Generator>
Required

The image file.

cache_image
bool
default value: None

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

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

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

operation_config
Required

Operation configuration overrides.

Returns

Evaluate or ClientRawResponse if raw=true

Return type

Exceptions

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

cache_image
bool
default value: None

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

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Evaluate or ClientRawResponse if raw=true

Return type

Exceptions

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

content_type
str
Required

The content type.

cache_image
bool
default value: None

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

data_representation
str
default value: URL
value
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Evaluate or ClientRawResponse if raw=true

Return type

Exceptions

find_faces

Returns the list of faces found.

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

Parameters

cache_image
bool
default value: None

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

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

FoundFaces or ClientRawResponse if raw=true

Return type

Exceptions

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

image_stream
<xref:Generator>
Required

The image file.

cache_image
bool
default value: None

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

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

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

operation_config
Required

Operation configuration overrides.

Returns

FoundFaces or ClientRawResponse if raw=true

Return type

Exceptions

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

content_type
str
Required

The content type.

cache_image
bool
default value: None

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

data_representation
str
default value: URL
value
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

FoundFaces or ClientRawResponse if raw=true

Return type

Exceptions

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

image_stream
<xref:Generator>
Required

The image file.

list_id
str
default value: None

The list Id.

cache_image
bool
default value: None

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

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

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

operation_config
Required

Operation configuration overrides.

Returns

MatchResponse or ClientRawResponse if raw=true

Return type

Exceptions

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

list_id
str
default value: None

The list Id.

cache_image
bool
default value: None

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

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

MatchResponse or ClientRawResponse if raw=true

Return type

Exceptions

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

content_type
str
Required

The content type.

list_id
str
default value: None

The list Id.

cache_image
bool
default value: None

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

data_representation
str
default value: URL
value
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

MatchResponse or ClientRawResponse if raw=true

Return type

Exceptions

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

language
str
Required

Language of the terms.

image_stream
<xref:Generator>
Required

The image file.

cache_image
bool
default value: None

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

enhanced
bool
default value: False

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.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

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

operation_config
Required

Operation configuration overrides.

Returns

OCR or ClientRawResponse if raw=true

Return type

OCR,

Exceptions

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

language
str
Required

Language of the terms.

cache_image
bool
default value: None

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

enhanced
bool
default value: False

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.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

OCR or ClientRawResponse if raw=true

Return type

OCR,

Exceptions

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

language
str
Required

Language of the terms.

content_type
str
Required

The content type.

cache_image
bool
default value: None

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

enhanced
bool
default value: False

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.

data_representation
str
default value: URL
value
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

OCR or ClientRawResponse if raw=true

Return type

OCR,

Exceptions

Attributes

models

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