PHP - Blocking of uploaded adult images

后端 未结 12 1050
无人及你
无人及你 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:

    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)

提交回复
热议问题