定制 alisoleimani/nsfw-detector 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固