Image Moderation

Image Moderation detects and recognizes inappropriate and unsafe content in images. The criteria include suggestive or explicit racy content, nudity, violence, gore, bloodshed, and the presence of weapons and drugs.

You can provide a .jpg/.jpeg or .png file as the input to the open() method. This method returns the image file object as a response.

You can set the moderation mode as BASIC, MODERATE, or ADVANCED optionally. The image is processed in the ADVANCED mode by default.

The response returns the probability of each criteria with their confidence scores, and the prediction of the image being safe_to_use or unsafe_to_use.

The zia reference used below is already defined in the component instance page.

    
copy
img = open('sample.jpg', 'rb') result = zia.moderate_image(img, options={'mode': 'moderate'})

A sample response is shown below :

    
copy
{"probability":{"racy":"0.09","nudity":"0.06"},"confidence":"0.85","prediction":"safe_to_use"}

Last Updated 2023-12-18 16:20:08 +0530 +0530

ON THIS PAGE

RELATED LINKS

Image Moderation - API