- 授权协议: Apache
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/rockyzhengwu/nsfw
- 软件文档: https://github.com/rockyzhengwu/nsfw
- 官方下载: https://github.com/rockyzhengwu/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 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
Cracking the Coding Interview
Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95
Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!

