Blurit 是一个 SDK,用于匿名化包含面部和车牌的图片和视频。
欲了解更多关于 Blurit 的信息,请访问我们的网站。
CocoaPods 是将 Blurit 添加到您项目的推荐方式。
pod 'Blurit_SDK'
通过运行 pod install
安装 pod。
在您需要的地方包含 Blurit,Objective-C 使用 #import <Blurit/Blurit.h>
,Swift 使用 import Blurit
。
dependencies: [
.package(url: "https://github.com/wassafr/Blurit-ios.git", from: "1.0.0")
]
下载最新代码版本,或将该仓库作为 git 子模块添加到您使用 git 跟踪的项目中。
在您需要的地方包含 Blurit,Objective-C 使用 #import <Blurit_SDK/Blurit_SDK.h>
,Swift 使用 import Blurit_SDK
。
要运行示例项目,只需打开并运行即可。框架已包含在内。请确保您也查看了Blurit 文档。 注意: 要使用 SDK,您需要一个许可证密钥,您可以从 Blurit 网站获取。
示例代码已添加注释,并展示了 SDK 的使用示例。
###基础知识
import Blurit
`` bluritInstance = Blurit(licenceKey: "your license key", completion: nil)
3. Load the detection models in the Blurit instance
bluritInstance?.loadModels(completion: { (error) in if let error = error { print("❌ 无法初始化 Blurit (error.localizedDescription)") } else {
} })
4. Make prediction from picture
BluritService.shared.bluritInstance?.detectObjectsAsync(sourceImage: image, completion: { firstCompletionResult in
/// Handle detected objects
})
5. You can now use predictions to apply the blur
BluritService.shared.bluritInstance?.anonymizeAsync(sourceImage: image, predictionResult: predictionResult, completion: { secondCompletionResult in
/// Handle blurred picture
})
Blurit 在商业许可证下可用。有关更多信息,请参阅 LICENSE 文件。
Wassa, contact@wassa.fr