写在后面:不要找我要练习数据,我是遵纪尊法的好国民,练习数据曾经删除。
几天前看到 GitHub 上用于黄图辨别的数据, 就 down 回来做了个黄图辨别的模子,现模子已开源:nsfw 。 在线demo
练习数据共五个种别:
porn - pornography images *** - *** images, but also includes pornographic drawings sexy - sexually explicit images, but not pornography. Think nude photos, ***, bikini, beach volleyball, etc. neutral - safe for work neutral images of everyday things and people drawings - safe for work drawings (including ***)
练习数据的数目以下:
drawing: 18251 ***: 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, '***': 0.0011919827, 'neutral': 0.13077603, 'porn': 0.13146976, 'sexy': 0.72824186}}
class
: 图片所属列表 probability
: 各种别所属的几率得分
也能够运用 Tensorflow Serving 安排,概况可以检查nsfw
模子部分采取 Resnet ,首要参考了 Tensorflow 官方的代码 做了少量修正。概况见 resnet
目次下。 测验考试了微谐和练习一个绝对容易的新模子,微调的后果其实不好,反而速度会慢非常多。我想是由于这些图片和ImageNet 数据集相差太大的原因。终极宣布的模子运用Resnet-32, 精确率 90% 。
2KB项目(www.2kb.com,源码交易平台),提供担保交易、源码交易、虚拟商品、在家创业、在线创业、任务交易、网站设计、软件设计、网络兼职、站长交易、域名交易、链接买卖、网站交易、广告买卖、站长培训、建站美工等服务