Last active
April 5, 2020 16:52
-
-
Save AleksandraZuchewicz/de91387213e6a8e379759b18473ab0ca to your computer and use it in GitHub Desktop.
Used in: Testing explicit content of the website with Google Cloud Vision API -SafeSearch Detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const vision = require("@google-cloud/vision"); | |
const fileName = "./screenshots/google.png"; | |
const client = new vision.ImageAnnotatorClient(); | |
(async function save() { | |
const [result] = await client.safeSearchDetection(fileName); | |
const detections = result.safeSearchAnnotation; | |
console.log(`Adult: ${detections.adult}`); | |
console.log(`Medical: ${detections.medical}`); | |
console.log(`Spoof: ${detections.spoof}`); | |
console.log(`Violence: ${detections.violence}`); | |
console.log(`Racy: ${detections.racy}`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment