nsfw 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
nsfw 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
nsfw 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 Apache-2.0
开发语言 Python 查看源码 »
操作系统 跨平台
软件类型 开源软件
开源组织
地区 国产
投 递 者 正_午
适用人群 未知
收录时间 2019-01-23

软件简介

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

几天前看到 GitHub 上用于黄图鉴别的数据, 就 down 回来做了个黄图鉴别的模型,现模型已开源,在线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

展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击加入讨论🔥(2)
发表了资讯
2019/01/23 10:29

黄图鉴别工具 nsfw 首发

写在前面:不要找我要训练数据,我是遵纪守法的好公民,训练数据已经删除。 几天前看到 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 volleyba...

41
133
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
2 评论
39 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部