NsfwImgDetector 1.0.0

NsfwImgDetector 1.0.0

zhulmin 维护。



  • zhulmin

NsfwImgDetector

CI Status Version License Platform

NsfwDetector CoreML 模型用于扫描图像中是否存在裸露。它是由 yahoo 模型 转换而来的 coffe 模型。

示例

要运行示例项目,首先克隆仓库,然后从 Example 目录运行 pod install

要求

swift 5.0

用法

@available(iOS 11.0, *)
func filter(image:UIImage) {
    
    let detector = NsfwImgDetector()

    detector.check(image: image) { (isNoSafe, confidence) in
        print("isNoSafe:\(isNoSafe) confidence:\(confidence)")
        if isNoSafe == false {
            //safe
        }else if (confidence > 0.9) {
            // porn
        }else if (confidence > 0.5) {
            // sexy picture, may porn
        }else {
            // sexy picture
        }
    }
}

安装

NsfwImgDetector 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'NsfwImgDetector'

作者

[email ;protected]

许可

NsfwImgDetector 在 BCD 许可证下提供。有关更多信息,请参阅 LICENSE 文件。