Sign inSign up

icret/nsfw_restful_api

By icret

•Updated over 4 years ago

图像鉴黄,支持 restful api 鉴黄,精准度达到 93%

Image
5

3.7K

icret/nsfw_restful_api repository overview

⁠nsfwjs 鉴黄API

项目地址:简单图床 EasyImage2.0⁠

⁠使用方法

拉去镜像

docker pull icret/nsfw_restful_api:latest

或者直接

docker run -p 3307:3307 -d icret/nsfw_restful_api

⁠简单图床使用方法

  • 后台API设置中填入网址,比如:http://127.0.0.1:3307/api/nsfw/classify?url=
  • 后台图片安全图片鉴黄以nsfwjs方式

⁠测试

curl --location --request GET 'http://127.0.0.1:3307/api/nsfw/classify?url=https://i1.100024.xyz/i/2022/03/01/pidva8.jpg'

响应:

[{
	"className": "Drawing",
	"probability": 0.824431836605072
}, {
	"className": "Hentai",
	"probability": 0.16360442340373993
}, {
	"className": "Neutral",
	"probability": 0.007620695047080517
}, {
	"className": "Porn",
	"probability": 0.004154415801167488
}, {
	"className": "Sexy",
	"probability": 0.00018858206749428064
}]

⁠上传图片后,总共会返回 5 个维度的数值来鉴别该图片的尺度:

  • 绘画(Drawing)—— 无害的艺术,或艺术绘画;
  • 变态(Hentai)—— 色情艺术,不适合大多数工作环境;
  • 中立(Neutral)—— 一般,无害的内容;
  • 色情(Porn)—— 不雅的内容和行为,通常涉及生殖器;
  • 性感(Sexy)—— 不合时宜的挑衅内容。
  • 当porn评分超过>=0.6左右,就几乎是一张带有色情性质的图片了。

⁠使用问题

  • webp格式无法鉴黄

Tag summary

Content type

Image

Digest

Size

501.7 MB

Last updated

over 4 years ago

docker pull icret/nsfw_restful_api