alisoleimani/nsfw-detector
Composer 安装命令:
composer require alisoleimani/nsfw-detector
包简介
nsfw detector php
README 文档
README
NSFW (Not Safe for Work) Detector actually is a python script but its integrated with php
Installation
Python Installation
pip install --upgrade TensorFlow
pip install nsfw-detector
PHP Installation
composer require alisoleimani/nsfw-detector
Usage/Examples
Basic Usage
$filePath = "path-to-file/file.png"; $data = NSFW::predict($filePath); // data will be like // {'drawings': 0.0024894224479794502, 'hentai': 0.0009175422019325197, 'neutral': 0.9905469417572021, 'porn': 0.00509273586794734, 'sexy': 0.0009534107521176338} // The higher these values, the more likely the photo is to be unsafe
Don`t Panic! You can use detect method for a boolean value then say image is safe or not
$filePath = "path-to-file/file.png"; $situation = NSFW::detect($filePath); // if $sitation is true it means image is not safe and if its false image will be secure
Authors
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-20