Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
wassafr | dbbd592145 | |
wassafr | 3bc13758b9 |
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |spec|
|
||||
spec.name = "Blurit"
|
||||
spec.version = "1.0.0"
|
||||
spec.version = "1.0.1"
|
||||
spec.summary = "Blurit is an SDK to anonymize pictures and videos containing faces and car plates."
|
||||
spec.description = <<-DESC
|
||||
Blurit is able to track multiple faces and then detect gender and age for each detected face.
|
||||
|
|
|
@ -4,6 +4,18 @@
|
|||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Blurit_SDK.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-x86_64-simulator</string>
|
||||
|
@ -18,18 +30,6 @@
|
|||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Blurit_SDK.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
|
|
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
# Blurit
|
||||
![Blurit](logo_blurit.png)
|
||||
|
||||
[![Version](https://img.shields.io/cocoapods/v/Blurit?style=flat)](http://cocoapods.org/pods/Blurit)
|
||||
[![License](https://img.shields.io/cocoapods/l/Blurit?style=flat)](http://cocoapods.org/pods/Blurit)
|
||||
|
@ -18,12 +18,12 @@ For more information about Blurit you can visit our [website](http://blurit.io/l
|
|||
1. Add a pod entry for Blurit to your *Podfile* :
|
||||
|
||||
```
|
||||
pod 'Blurit_SDK'
|
||||
pod 'Blurit'
|
||||
```
|
||||
|
||||
2. Install the pod(s) by running `pod install`.
|
||||
|
||||
3. Include Blurit wherever you need it with `#import <Blurit/Blurit.h>` from Objective-C or `import Blurit` from Swift.
|
||||
3. Include Blurit wherever you need it with `#import <Blurit_SDK/Blurit_SDK.h>` from Objective-C or `import Blurit_SDK` from Swift.
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
|
@ -47,50 +47,62 @@ Make sure you also see [Blurit documentation](https://services.wassa.io/api/glob
|
|||
|
||||
The sample code is commented and show usage examples of the SDK.
|
||||
|
||||
###Basics
|
||||
### Basics
|
||||
|
||||
1. Add the following import to the top of the file :
|
||||
|
||||
```
|
||||
```swift
|
||||
import Blurit
|
||||
|
||||
```
|
||||
|
||||
2. Instantiate a Blurit object
|
||||
|
||||
``
|
||||
bluritInstance = Blurit(licenceKey: "your license key", completion: nil)
|
||||
```swift
|
||||
bluritInstance = Blurit(licenceKey: <#your license#>, completion: nil)
|
||||
```
|
||||
|
||||
3. Load the detection models in the Blurit instance
|
||||
```
|
||||
```swift
|
||||
bluritInstance?.loadModels(completion: { (error) in
|
||||
if let error = error {
|
||||
print("❌ Cannot initialize Blurit \(error.localizedDescription)")
|
||||
} else {
|
||||
|
||||
// The loading has completed ‼️
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
4. Make prediction from picture
|
||||
```
|
||||
BluritService.shared.bluritInstance?.detectObjectsAsync(sourceImage: image, completion: { firstCompletionResult in
|
||||
|
||||
/// Handle detected objects
|
||||
4. Make prediction from picture<br>
|
||||
⚠️ Be careful, you must make sure the model loading has completed before using this method.
|
||||
```swift
|
||||
bluritInstance?.detectObjectsAsync(sourceImage: image, completion: { firstCompletionResult in
|
||||
switch firstCompletionResult {
|
||||
case .success(let predictionResult):
|
||||
/// Handle detected objects with `anonymizeAsync` or `anonymizeSync`
|
||||
case .failure(let error):
|
||||
/// Handle error
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
``````
|
||||
```
|
||||
|
||||
5. You can now use prediction for gender and age
|
||||
|
||||
BluritService.shared.bluritInstance?.anonymizeAsync(sourceImage: image, predictionResult: predictionResult, completion: { secondCompletionResult in
|
||||
5. You can now use predictions to apply the blur
|
||||
```swift
|
||||
bluritInstance?.anonymizeAsync(sourceImage: image, predictionResult: predictionResult, completion: { secondCompletionResult in
|
||||
|
||||
switch firstCompletionResult {
|
||||
case .success(let blurredImage):
|
||||
/// Handle your image
|
||||
case .failure(let error):
|
||||
/// Handle error
|
||||
}
|
||||
/// Handle blurred picture
|
||||
|
||||
})
|
||||
|
||||
``````
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
## Synopsis
|
||||
|
||||
Blurit is an SDK to anonymize picture and videos containing faces and car plates.<br>
|
||||
For more information about Blurit you can visit our [website](http://blurit.io/library/ios).
|
||||
|
||||
## Environment setup & installation
|
||||
|
||||
- XCode 12.0+
|
||||
|
|
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
# Blurit
|
||||
![Blurit](logo_blurit.png)
|
||||
|
||||
[![Version](https://img.shields.io/cocoapods/v/Blurit?style=flat)](http://cocoapods.org/pods/Blurit)
|
||||
[![License](https://img.shields.io/cocoapods/l/Blurit?style=flat)](http://cocoapods.org/pods/Blurit)
|
||||
|
@ -18,12 +18,12 @@ For more information about Blurit you can visit our [website](http://blurit.io/l
|
|||
1. Add a pod entry for Blurit to your *Podfile* :
|
||||
|
||||
```
|
||||
pod 'Blurit_SDK'
|
||||
pod 'Blurit'
|
||||
```
|
||||
|
||||
2. Install the pod(s) by running `pod install`.
|
||||
|
||||
3. Include Blurit wherever you need it with `#import <Blurit/Blurit.h>` from Objective-C or `import Blurit` from Swift.
|
||||
3. Include Blurit wherever you need it with `#import <Blurit_SDK/Blurit_SDK.h>` from Objective-C or `import Blurit_SDK` from Swift.
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
|
@ -47,50 +47,62 @@ Make sure you also see [Blurit documentation](https://services.wassa.io/api/glob
|
|||
|
||||
The sample code is commented and show usage examples of the SDK.
|
||||
|
||||
###Basics
|
||||
### Basics
|
||||
|
||||
1. Add the following import to the top of the file :
|
||||
|
||||
```
|
||||
```swift
|
||||
import Blurit
|
||||
|
||||
```
|
||||
|
||||
2. Instantiate a Blurit object
|
||||
|
||||
``
|
||||
bluritInstance = Blurit(licenceKey: "your license key", completion: nil)
|
||||
```swift
|
||||
bluritInstance = Blurit(licenceKey: <#your license#>, completion: nil)
|
||||
```
|
||||
|
||||
3. Load the detection models in the Blurit instance
|
||||
```
|
||||
```swift
|
||||
bluritInstance?.loadModels(completion: { (error) in
|
||||
if let error = error {
|
||||
print("❌ Cannot initialize Blurit \(error.localizedDescription)")
|
||||
} else {
|
||||
|
||||
// The loading has completed ‼️
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
4. Make prediction from picture
|
||||
```
|
||||
BluritService.shared.bluritInstance?.detectObjectsAsync(sourceImage: image, completion: { firstCompletionResult in
|
||||
|
||||
/// Handle detected objects
|
||||
4. Make prediction from picture<br>
|
||||
⚠️ Be careful, you must make sure the model loading has completed before using this method.
|
||||
```swift
|
||||
bluritInstance?.detectObjectsAsync(sourceImage: image, completion: { firstCompletionResult in
|
||||
switch firstCompletionResult {
|
||||
case .success(let predictionResult):
|
||||
/// Handle detected objects with `anonymizeAsync` or `anonymizeSync`
|
||||
case .failure(let error):
|
||||
/// Handle error
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
``````
|
||||
```
|
||||
|
||||
5. You can now use prediction for gender and age
|
||||
|
||||
BluritService.shared.bluritInstance?.anonymizeAsync(sourceImage: image, predictionResult: predictionResult, completion: { secondCompletionResult in
|
||||
5. You can now use predictions to apply the blur
|
||||
```swift
|
||||
bluritInstance?.anonymizeAsync(sourceImage: image, predictionResult: predictionResult, completion: { secondCompletionResult in
|
||||
|
||||
switch firstCompletionResult {
|
||||
case .success(let blurredImage):
|
||||
/// Handle your image
|
||||
case .failure(let error):
|
||||
/// Handle error
|
||||
}
|
||||
/// Handle blurred picture
|
||||
|
||||
})
|
||||
|
||||
``````
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
## Synopsis
|
||||
|
||||
Blurit is an SDK to anonymize picture and videos containing faces and car plates.<br>
|
||||
For more information about Blurit you can visit our [website](http://blurit.io/library/ios).
|
||||
|
||||
## Environment setup & installation
|
||||
|
||||
- XCode 12.0+
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</data>
|
||||
<key>EXTERNALREADME.md</key>
|
||||
<data>
|
||||
qiqMUC7VDUyxNOmRbmnIiDD/xr4=
|
||||
hguta1JCmwWiWxGj2iPSFK7xQtI=
|
||||
</data>
|
||||
<key>Headers/Blurit_SDK-Swift.h</key>
|
||||
<data>
|
||||
|
@ -70,7 +70,7 @@
|
|||
</data>
|
||||
<key>README.md</key>
|
||||
<data>
|
||||
iRvHzDk5bbZ29Y+KastZYxOkgao=
|
||||
5fui5usGZ8LSEPtmyd6KjIHLFX8=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
|
@ -100,7 +100,7 @@
|
|||
<dict>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
7KPZVn/UXpZgRCTWO+Eg4vQLSHsdaFFbfbEwDlunQ3o=
|
||||
S9Zrs9rm3feuyaYpWLkcmdH4PaPy4fjLJRHlGSlTgHI=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/Blurit_SDK-Swift.h</key>
|
||||
|
@ -184,7 +184,7 @@
|
|||
<dict>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
n16dJqv8U7weSFHiGdo4QvM6hRx5lBWEUTIGNq9c7FM=
|
||||
zCuBt39V7JDsMzG8DGN+EhQkzzcjV81zY2uyJ+5VCSY=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
|
|
BIN
Blurit_SDK.zip
BIN
Blurit_SDK.zip
Binary file not shown.
|
@ -129,7 +129,6 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
DC2A648E26A86CE0004D1AA6 /* AppDelegate.swift */,
|
||||
DC89451027188A7E003B88B1 /* Model */,
|
||||
DCEC290626C186A90023203F /* Services */,
|
||||
DC2A649026A86CE0004D1AA6 /* SceneDelegate.swift */,
|
||||
DC883C4426C4234100ED2086 /* ViewControllers */,
|
||||
|
@ -321,13 +320,6 @@
|
|||
path = ViewControllers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DC89451027188A7E003B88B1 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DC8945152719CAD4003B88B1 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
|
|
@ -9,13 +9,15 @@ import Blurit_SDK
|
|||
|
||||
class BluritService {
|
||||
|
||||
let licenseKey = ""
|
||||
let licenseKey: String = <#name#>
|
||||
|
||||
static let shared = BluritService() // 2. Shared instance
|
||||
private init() {}
|
||||
|
||||
var bluritInstance: Blurit?
|
||||
var serviceStarted = false
|
||||
|
||||
var startingError: Error?
|
||||
|
||||
/**
|
||||
The service must be initialized at the app starting
|
||||
*/
|
||||
|
@ -24,10 +26,13 @@ class BluritService {
|
|||
DispatchQueue.global().async {
|
||||
self.bluritInstance?.loadModels(completion: { (error) in
|
||||
if let error = error {
|
||||
print("❌ Cannot initialize Blurit \(error.localizedDescription)")
|
||||
self.startingError = error
|
||||
print("❌ Cannot initialize Blurit: \(error.localizedDescription)")
|
||||
} else {
|
||||
print("Facelytics model successfully loaded ✅")
|
||||
print("Blurit model successfully loaded ✅")
|
||||
self.serviceStarted = true
|
||||
self.startingError = nil
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -48,8 +48,13 @@ class HomeViewController: UIViewController {
|
|||
}
|
||||
|
||||
func handlePickedImage(image: UIImage) {
|
||||
if let error = BluritService.shared.startingError {
|
||||
self.alert("Blurit init error", error.localizedDescription, nil)
|
||||
return
|
||||
}
|
||||
|
||||
guard BluritService.shared.serviceStarted else {
|
||||
self.alert(nil, "Service not yet started", nil)
|
||||
self.alert(nil, "Service not yet started, wait a few more seconds", nil)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// VideoBlurredDetailsViewController.swift
|
||||
// FacelyticsSDKSampleProject
|
||||
// BluritSDKSampleProject
|
||||
//
|
||||
// Created by Bertrand VILLAIN on 15/10/2021.
|
||||
// Copyright © 2021 Wassa. All rights reserved.
|
||||
|
|
51
README.md
51
README.md
|
@ -1,4 +1,4 @@
|
|||
# Blurit
|
||||
![Blurit](logo_blurit.png)
|
||||
|
||||
[![Version](https://img.shields.io/cocoapods/v/Blurit?style=flat)](http://cocoapods.org/pods/Blurit)
|
||||
[![License](https://img.shields.io/cocoapods/l/Blurit?style=flat)](http://cocoapods.org/pods/Blurit)
|
||||
|
@ -18,12 +18,12 @@ For more information about Blurit you can visit our [website](http://blurit.io/l
|
|||
1. Add a pod entry for Blurit to your *Podfile* :
|
||||
|
||||
```
|
||||
pod 'Blurit_SDK'
|
||||
pod 'Blurit'
|
||||
```
|
||||
|
||||
2. Install the pod(s) by running `pod install`.
|
||||
|
||||
3. Include Blurit wherever you need it with `#import <Blurit/Blurit.h>` from Objective-C or `import Blurit` from Swift.
|
||||
3. Include Blurit wherever you need it with `#import <Blurit_SDK/Blurit_SDK.h>` from Objective-C or `import Blurit_SDK` from Swift.
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
|
@ -47,50 +47,61 @@ Make sure you also see [Blurit documentation](https://services.wassa.io/api/glob
|
|||
|
||||
The sample code is commented and show usage examples of the SDK.
|
||||
|
||||
###Basics
|
||||
### Basics
|
||||
|
||||
1. Add the following import to the top of the file :
|
||||
|
||||
```
|
||||
```swift
|
||||
import Blurit
|
||||
|
||||
```
|
||||
|
||||
2. Instantiate a Blurit object
|
||||
|
||||
``
|
||||
bluritInstance = Blurit(licenceKey: "your license key", completion: nil)
|
||||
```swift
|
||||
bluritInstance = Blurit(licenceKey: <#your license#>, completion: nil)
|
||||
```
|
||||
|
||||
3. Load the detection models in the Blurit instance
|
||||
```
|
||||
```swift
|
||||
bluritInstance?.loadModels(completion: { (error) in
|
||||
if let error = error {
|
||||
print("❌ Cannot initialize Blurit \(error.localizedDescription)")
|
||||
} else {
|
||||
|
||||
// The loading has completed ‼️
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
4. Make prediction from picture
|
||||
```
|
||||
BluritService.shared.bluritInstance?.detectObjectsAsync(sourceImage: image, completion: { firstCompletionResult in
|
||||
|
||||
/// Handle detected objects
|
||||
4. Make prediction from picture<br>
|
||||
⚠️ Be careful, you must make sure the model loading has completed before using this method.
|
||||
```swift
|
||||
bluritInstance?.detectObjectsAsync(sourceImage: image, completion: { firstCompletionResult in
|
||||
switch firstCompletionResult {
|
||||
case .success(let predictionResult):
|
||||
/// Handle detected objects with `anonymizeAsync` or `anonymizeSync`
|
||||
case .failure(let error):
|
||||
/// Handle error
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
``````
|
||||
```
|
||||
|
||||
5. You can now use predictions to apply the blur
|
||||
|
||||
BluritService.shared.bluritInstance?.anonymizeAsync(sourceImage: image, predictionResult: predictionResult, completion: { secondCompletionResult in
|
||||
5. You can now use predictions to apply the blur
|
||||
```swift
|
||||
bluritInstance?.anonymizeAsync(sourceImage: image, predictionResult: predictionResult, completion: { secondCompletionResult in
|
||||
|
||||
/// Handle blurred picture
|
||||
switch secondCompletionResult {
|
||||
case .success(let blurredImage):
|
||||
/// Handle your image
|
||||
case .failure(let error):
|
||||
/// Handle error
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
``````
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Loading…
Reference in New Issue