黄图鉴别工具 nsfw

码农软件 · 软件分类 · 其他开发相关 · 2019-10-15 23:12:38

软件介绍

黄图鉴别工具

写在前面:不要找我要训练数据,我是遵纪守法的好公民,训练数据已经删除。

几天前看到 GitHub 上用于黄图鉴别的数据, 就 down 回来做了个黄图鉴别的模型,现模型已开源:nsfw在线demo

数据

训练数据共五个类别:

porn - pornography images hentai - hentai images, but also includes pornographic drawings sexy - sexually explicit images, but not pornography. Think nude photos, playboy, bikini, beach volleyball, etc. neutral - safe for work neutral images of everyday things and people drawings - safe for work drawings (including anime)

训练数据的数量如下:

drawing: 18251 hentai: 42649 netural: 44677 porn: 108114 sexy: 17253

使用

可以直接下载代码和训练好的模型来用 下载代码和模型

git clone https://github.com/rockyzhengwu/nsfw.git

训练好的模型在 /data/目录下。

cd nsfw
python nsfw_predict.py /tmp/test/test.jpeg

输出结果:

{'class': 'sexy', 'probability': {'drawings': 0.008320281, 'hentai': 0.0011919827, 'neutral': 0.13077603, 'porn': 0.13146976, 'sexy': 0.72824186}}

class: 图片所属列表 probability: 各类别所属的概率得分

也可以使用 Tensorflow Serving 部署,详情可以查看nsfw

模型

模型部分采用 Resnet ,主要参考了 Tensorflow 官方的代码 做了少许修改。详情见 resnet目录下。 尝试了微调和训练一个相对简单的新模型,微调的效果并不好,反而速度会慢很多。我想是因为这些图片和ImageNet 数据集相差太大的缘故。最终发布的模型使用Resnet-32, 准确率 90% 。

如有建议可邮件: zhengwu@midday.me

本文地址:https://www.codercto.com/soft/d/16849.html

A Philosophy of Software Design

A Philosophy of Software Design

John Ousterhout / Yaknyam Press / 2018-4-6 / GBP 14.21

This book addresses the topic of software design: how to decompose complex software systems into modules (such as classes and methods) that can be implemented relatively independently. The book first ......一起来看看 《A Philosophy of Software Design》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具