{
  "title": "NSFW protection",
  "video_id": "fnL1J6lm9a0",
  "published": "2024-09-22T14:56:33+0000",
  "complexity": "Easy",
  "old_url": "https://workflows-of-ai.com/workflow/nsfw-protection",
  "description": "Stop NSFW image uploads in Drupal with AI Validations, Field Validation and the free Falconsai NSFW detection model on Hugging Face.",
  "subtitle": "Stop not-safe-for-work images at upload with a free image classification model from Hugging Face and the AI Validations module.",
  "summary": "AI Validations, a submodule of the AI module written by Frederik Wouters, adds AI constraints to the Field Validation module. With a Hugging Face key and the Falconsai NSFW detection model, an article image field rejects any upload the model labels as nsfw with at least 0.8 confidence. The model is tried first in the AI API Explorer, and other image classification models on Hugging Face work the same way.",
  "categories": [
    "Drupal AI"
  ],
  "intro_html": "<p>In this video we will showcase how to use the AI module to set up field validations on your image fields, so people can't upload NSFW images.</p><p>NOTE: This will showcase a mild NSFW image of Justin Bieber in underwear from his Calvin Klein campaign.</p><p>This will use the AI Validations submodule in the AI module and the Field Validation module, together with the <code>Falconsai/nsfw_image_detection</code> model from Hugging Face, to make sure that you can't upload bad images.</p><p>It's very simple to set up and very powerful.</p><p>Links:<br>FreelyGive: <a href=\"https://freelygive.io/\">https://freelygive.io/</a><br>Drupal AI module: <a href=\"https://www.drupal.org/project/ai\">https://www.drupal.org/project/ai</a><br>Frederik Wouters: <a href=\"https://www.drupal.org/u/wouters_f\">https://www.drupal.org/u/wouters_f</a><br>Hugging Face model: <a href=\"https://huggingface.co/Falconsai/nsfw_image_detection\">https://huggingface.co/Falconsai/nsfw_image_detection</a><br>Field Validation: <a href=\"https://www.drupal.org/project/field_validation\">https://www.drupal.org/project/field_validation</a></p>",
  "intro_added": false,
  "chapters": [
    "0:00 Blocking NSFW image uploads",
    "1:42 AI Validations and Field Validation",
    "2:32 A free model on Hugging Face",
    "4:16 Installing the modules",
    "5:17 Setting up the Hugging Face key",
    "6:30 Adding the Falconsai model",
    "7:15 Testing in the AI API Explorer",
    "9:09 Adding the field validation rule",
    "11:05 Uploading as an editor",
    "11:49 Other image classification models"
  ],
  "corrections": [
    [
      "freely give",
      "FreelyGive"
    ],
    [
      "druple",
      "Drupal"
    ],
    [
      "Frederick",
      "Frederik"
    ],
    [
      "Fredick",
      "Frederik"
    ],
    [
      "Walters",
      "Wouters"
    ],
    [
      "hugging phase",
      "Hugging Face"
    ],
    [
      "hugging faces",
      "Hugging Face"
    ],
    [
      "hugging face",
      "Hugging Face"
    ],
    [
      "huging face",
      "Hugging Face"
    ],
    [
      "Falcon AI",
      "Falconsai"
    ],
    [
      "Falcons Ai",
      "Falconsai"
    ],
    [
      "Ian numbers",
      "IBAN numbers"
    ],
    [
      "Asher",
      "Azure"
    ],
    [
      "asure",
      "Azure"
    ]
  ],
  "ai_note": "The video and the introduction are Marcus's own, first published on workflows-of-ai.com. AI wrote the subtitle, the summary and the video chapters from the transcript, and corrected misheard names in YouTube's automatic captions."
}