fix: NSFW 检测分无论是否命中阈值都入库
This commit is contained in:
@@ -556,13 +556,13 @@ func (o *Organizer) ProcessImages(images []scanner.File) {
|
|||||||
// 正常图片:按分辨率/方向/明暗归入对应的分类目录;
|
// 正常图片:按分辨率/方向/明暗归入对应的分类目录;
|
||||||
// 被判为色情的改去「图片_敏感_*」目录,明暗子目录照常保留
|
// 被判为色情的改去「图片_敏感_*」目录,明暗子目录照常保留
|
||||||
info := o.record(f, "image", r.res, r.md5Str, r.headMd5, r.tailMd5, r.size)
|
info := o.record(f, "image", r.res, r.md5Str, r.headMd5, r.tailMd5, r.size)
|
||||||
|
// 检测过的图片都记录分数(不管是否命中阈值),方便后续调整阈值重新判定
|
||||||
|
if info != nil && r.nsfwScore > 0 {
|
||||||
|
info.NsfwScore = r.nsfwScore
|
||||||
|
info.NsfwThreshold = o.nsfw.Threshold()
|
||||||
|
}
|
||||||
if r.nsfw {
|
if r.nsfw {
|
||||||
o.addClassified(f, classify.ImageDirSensitive(f.Ext, r.res.Width, r.res.Height, r.darkScore, r.lightScore), r.size, r.headMd5, r.tailMd5)
|
o.addClassified(f, classify.ImageDirSensitive(f.Ext, r.res.Width, r.res.Height, r.darkScore, r.lightScore), r.size, r.headMd5, r.tailMd5)
|
||||||
// NSFW 结果直接写入 MediaInfo 记录
|
|
||||||
if info != nil {
|
|
||||||
info.NsfwScore = r.nsfwScore
|
|
||||||
info.NsfwThreshold = o.nsfw.Threshold()
|
|
||||||
}
|
|
||||||
nsfwCount++
|
nsfwCount++
|
||||||
} else {
|
} else {
|
||||||
o.addClassified(f, classify.ImageDir(f.Ext, r.res.Width, r.res.Height, r.darkScore, r.lightScore), r.size, r.headMd5, r.tailMd5)
|
o.addClassified(f, classify.ImageDir(f.Ext, r.res.Width, r.res.Height, r.darkScore, r.lightScore), r.size, r.headMd5, r.tailMd5)
|
||||||
|
|||||||
Reference in New Issue
Block a user