PHP - Blocking of uploaded adult images

后端 未结 12 963
无人及你
无人及你 2020-12-15 00:21

We have a setup a product management system where the head of the product development can upload pictures of products and those pictures will instantly show up on our websit

相关标签:
12条回答
  • 2020-12-15 00:32

    If you are looking for an API-based solution, you may want to check out Sightengine.com

    It's an automated solution to detect things like adult content, violence, celebrities etc in images and videos.

    Here is an example in PHP, using the SDK:

    <?php
    $client = new SightengineClient('YourApplicationID', 'YourAPIKey');
    
    $output = $client>check('nudity')>image('https://sightengine.com/assets/img/examples/example2.jpg');
    

    The output will then return the classification:

    {
      "status": "success",
      "request": {
        "id": "req_VjyxevVQYXQZ1HMbnwtn",
        "timestamp": 1471762434.0244,
        "operations": 1
      },
      "nudity": {
        "raw": 0.000757,
        "partial": 0.000763,
        "safe": 0.999243
      },
      "media": {
        "id": "med_KWmB2GQZ29N4MVpVdq5K",
        "uri": "https://sightengine.com/assets/img/examples/example2.jpg"
      }
    }
    

    Have a look at the documentation for more details: https://sightengine.com/docs/#nudity-detection (disclaimer: I work there)

    0 讨论(0)
  • 2020-12-15 00:32

    Trynt API has a very good / fast Nudity detection Web Service, but it seems to return a 502 header ATM.

    0 讨论(0)
  • 2020-12-15 00:33

    Try this i hope it will help you

    http://lab.yogeshsaroya.com/prevent-uploads-nude-or-adult-images-using-php/

    0 讨论(0)
  • 2020-12-15 00:34

    There is no reliable way of doing this. Whatever automated process you use will generate false positive and false negatives. If you're willing to accept that you could look at the Image Nudity Filter, which analyzes images based on skintone. It will tend to flag images that are close-ups of faces too however.

    Such a method might be effective in conjunction with information about a user's history. If they suddenly upload hundreds of images (when they might average two a week prior to that) and most of them get flagged then it's probably want to suspend those uploads until someone looks at them.

    Come to think of it, simply uploading a large number of images in a short period of time (and bringing that to the attention of the site admins) is probably sufficient most of the time.

    0 讨论(0)
  • 2020-12-15 00:41

    It's a difficult problem in any language, the image processing problem is extremely hard.

    There is some research on the subject:

    • Appearance-Based Nude Image Detection
    • SNIF: a simple nude image finder
    • Filtering Objectionable Image Based on Image Content
    0 讨论(0)
  • 2020-12-15 00:44

    It's possible although you will get false negatives and false positives.

    Much simpler would be to implement some form of moderation system which requires approval from another person before anything goes live.

    0 讨论(0)
提交回复
热议问题