Build

Real-time Image Moderation for Chat with Sightengine

2 min read PubNub Staff on Nov 17, 2016
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

Sightengine provides a simple API to analyze, moderate, and filter an image for nudity, profile image validation, or type check. Sightengine could be integrated to monitor a discussion group or forum,...

Sightengine provides a simple API to analyze, moderate, and filter an image for nudity, profile image validation, or type check. Sightengine could be integrated to monitor a discussion group or forum, and filter out user-generated photos that break code of conduct instantly. And now with the Sightengine PubNub Block for image moderation, you can scan and filter images in a real-time chat application or casual game, any app where users are sending and receiving images in real time.

Getting Started with Image Moderation

Getting started with Sightengine and BLOCKS couldn’t be easier. Head over to the BLOCKS catalog and click ‘Try it Now’. Create your free PubNub account first if you don’t already have one. Follow the prompts to create a copy of the Sightengine Block. Next you’ll need to get and write down your API user and API secret values.

Scroll down to where it says API key in the block code, and put in your API secret value. Now start the block. You can use the existing test payload or change it to your own. Just set the ‘image’ value to the url of an image you want to test. For example:

{
   "image": "http://38.media.tumblr.com/87cae843de33f3177c96fc2f7be17818/tumblr_inline_nfglzlv7971s6lw3t.jpg"
}

Now press the publish button to see the result. You will get something back like this:

{
   "nudity": { 
       "raw": 0.034964, 
       "partial": 0.043041, 
       "safe": 0.921994 
   },
   "media": {
       "uri":
         "http://38.media.tumblr.com/87cae843de33f3177c96fc2f7be17818/tumblr_inline_nfglzlv7971s6lw3t.jpg" 
   }
}

And that’s it!

With Sightengine you can scan for unsafe images in any message with their simple API. Beyond nudity detection, you can detect faces and people or determine if an image is a natural scene or an illustration, great functionality for any real-time application that involves user generation and submission of images.

More from PubNub

Top Trends to Engage Your App Users
InsightsSep 27, 20224 min read

Top Trends to Engage Your App Users

Take a look at the top trends that are the most effective in attracting customers and reducing churn, and how you can incorporate...

PubNub Staff

PubNub Staff

Comparing Game Engines: Unity vs Unreal vs the Rest
Real-Time Gaming BlogSep 21, 20225 min read

Comparing Game Engines: Unity vs Unreal vs the Rest

Comparing the major game engines: Unity vs Unreal Engine vs Corona SDK vs GameMaker Studio, including the benefits and cons of...

PubNub Staff

PubNub Staff

Python Socket Programming: Client, Server and Peer Libraries
BuildSep 21, 20226 min read

Python Socket Programming: Client, Server and Peer Libraries

Sockets (aka socket programming) enable programs to send and receive data, bi-directionally, at any given moment. This tutorial...

PubNub Staff

PubNub Staff