This article demonstrates the identification of explicit content (sexual, adult, spoofy, or violent using Google Cloud Vision.
What you'll need:
Skill level: Intermediate
Time required: 4 minutes
- Scheduler by Quickwork as a trigger for triggering the journey
- Google Cloud Vision action
- Skills to convert image content into a base64 string format
How to convert the content of an image into base64 string format
Images present on the internet or stored locally in an S3 bucket can be checked to verify if they have any amount of explicit content present or not. What is required is their content needs to be encoded in a base64 string format.
To encode an image present on the web into base64 string format, use Utilities by Quickwork app’s - Convert file content action. Click here to understand how to use it in detail.
To encode a locally stored image, visit https://www.base64encode.org/. Scroll downwards to find the Encode files to Base64 format section. Simply select a file from your device and click the Encode button. Once encoded, it shows a success message and provides a link to download the base64 output in the form of a text file:
Note: We need the encoded content of an image and not the encoded URL of the image.
Configuring the trigger
- Under the Event section, choose the Scheduler by Quickwork app from the drop-down menu in the Apps field present right below the New Trigger button.
- Select the trigger event, New scheduled event, from the drop-down menu in the Triggers field.
- Set the Interval as per your choice based on how often you need to run the journey.
- Set the date and time of your choice in the Start at field and keep the Custom payload field empty:
Configuring Google Cloud Vision action
- Under the Steps section, click on the Simple Action button and choose the Google Cloud Vision service from the drop-down menu in the Apps field.
- Select the Detect explicit content from base64 content of image action from the drop-down menu in the Actions field.
- Select an existing connection or create a new connection with your Google Cloud Vision account to use the required action.
- Once the connection has been created, you’ll see the input fields appear below. In the Image Base64 content field, paste the base64 content received in the downloaded text file:
Executing the journey
Save the changes of the journey and click the Save & Start button. You'll be taken to the History tab automatically. Click on the record that just got created. In the Steps section, click on the Google Cloud Vision action bar to expand and check the Output block to check the analysis received from Google Cloud Vision:
The image content has been successfully checked and verified for the presence of any kind of explicit content.