@nitro-mlkit/object-detection 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NitroMLKitObjects.podspec +34 -0
- package/README.md +57 -0
- package/android/CMakeLists.txt +12 -0
- package/android/build.gradle +77 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromlkit/objects/HybridObjectDetector.kt +102 -0
- package/android/src/main/kotlin/com/nitromlkit/objects/NitroMLKitObjectsPackage.kt +19 -0
- package/expo-module.config.json +9 -0
- package/ios/HybridObjectDetector.swift +125 -0
- package/nitro.json +16 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroMLKitObjects+autolinking.cmake +81 -0
- package/nitrogen/generated/android/NitroMLKitObjects+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroMLKitObjectsOnLoad.cpp +54 -0
- package/nitrogen/generated/android/NitroMLKitObjectsOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JBatchObjectResult.hpp +95 -0
- package/nitrogen/generated/android/c++/JDetectedObject.hpp +88 -0
- package/nitrogen/generated/android/c++/JHybridObjectDetectorSpec.cpp +131 -0
- package/nitrogen/generated/android/c++/JHybridObjectDetectorSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JObjectLabel.hpp +65 -0
- package/nitrogen/generated/android/c++/JObjectRect.hpp +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromlkit/objects/BatchObjectResult.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromlkit/objects/DetectedObject.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromlkit/objects/HybridObjectDetectorSpec.kt +63 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromlkit/objects/NitroMLKitObjectsOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromlkit/objects/ObjectLabel.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromlkit/objects/ObjectRect.kt +66 -0
- package/nitrogen/generated/ios/NitroMLKitObjects+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroMLKitObjects-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/NitroMLKitObjects-Swift-Cxx-Bridge.hpp +236 -0
- package/nitrogen/generated/ios/NitroMLKitObjects-Swift-Cxx-Umbrella.hpp +59 -0
- package/nitrogen/generated/ios/NitroMLKitObjectsAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroMLKitObjectsAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridObjectDetectorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridObjectDetectorSpecSwift.hpp +112 -0
- package/nitrogen/generated/ios/swift/BatchObjectResult.swift +63 -0
- package/nitrogen/generated/ios/swift/DetectedObject.swift +45 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_BatchObjectResult_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_DetectedObject_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridObjectDetectorSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridObjectDetectorSpec_cxx.swift +188 -0
- package/nitrogen/generated/ios/swift/ObjectLabel.swift +39 -0
- package/nitrogen/generated/ios/swift/ObjectRect.swift +44 -0
- package/nitrogen/generated/shared/c++/BatchObjectResult.hpp +99 -0
- package/nitrogen/generated/shared/c++/DetectedObject.hpp +96 -0
- package/nitrogen/generated/shared/c++/HybridObjectDetectorSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridObjectDetectorSpec.hpp +71 -0
- package/nitrogen/generated/shared/c++/ObjectLabel.hpp +91 -0
- package/nitrogen/generated/shared/c++/ObjectRect.hpp +95 -0
- package/package.json +53 -0
- package/src/index.ts +20 -0
- package/src/specs/ObjectDetector.nitro.ts +54 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridObjectDetectorSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitromlkit.objects
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Promise
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Kotlin class representing the ObjectDetector HybridObject.
|
|
18
|
+
* Implement this abstract class to create Kotlin-based instances of ObjectDetector.
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress(
|
|
23
|
+
"KotlinJniMissingFunction", "unused",
|
|
24
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
+
)
|
|
27
|
+
abstract class HybridObjectDetectorSpec: HybridObject() {
|
|
28
|
+
// Properties
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Methods
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
abstract fun detect(imageUri: String): Promise<Array<DetectedObject>>
|
|
35
|
+
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
abstract fun detectBatch(imageUris: Array<String>, concurrency: Double): Promise<Array<BatchObjectResult>>
|
|
39
|
+
|
|
40
|
+
@DoNotStrip
|
|
41
|
+
@Keep
|
|
42
|
+
abstract fun isAvailable(): Boolean
|
|
43
|
+
|
|
44
|
+
// Default implementation of `HybridObject.toString()`
|
|
45
|
+
override fun toString(): String {
|
|
46
|
+
return "[HybridObject ObjectDetector]"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// C++ backing class
|
|
50
|
+
@DoNotStrip
|
|
51
|
+
@Keep
|
|
52
|
+
protected open class CxxPart(javaPart: HybridObjectDetectorSpec): HybridObject.CxxPart(javaPart) {
|
|
53
|
+
// C++ JHybridObjectDetectorSpec::CxxPart::initHybrid(...)
|
|
54
|
+
external override fun initHybrid(): HybridData
|
|
55
|
+
}
|
|
56
|
+
override fun createCxxPart(): CxxPart {
|
|
57
|
+
return CxxPart(this)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
companion object {
|
|
61
|
+
protected const val TAG = "HybridObjectDetectorSpec"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMLKitObjectsOnLoad.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitromlkit.objects
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class NitroMLKitObjectsOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "NitroMLKitObjectsOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "NitroMLKitObjects".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading NitroMLKitObjects C++ library...")
|
|
25
|
+
System.loadLibrary("NitroMLKitObjects")
|
|
26
|
+
Log.i(TAG, "Successfully loaded NitroMLKitObjects C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load NitroMLKitObjects C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ObjectLabel.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitromlkit.objects
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "ObjectLabel".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class ObjectLabel(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val text: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val confidence: Double,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val index: Double
|
|
30
|
+
) {
|
|
31
|
+
/* primary constructor */
|
|
32
|
+
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is ObjectLabel) return false
|
|
36
|
+
return Objects.deepEquals(this.text, other.text)
|
|
37
|
+
&& Objects.deepEquals(this.confidence, other.confidence)
|
|
38
|
+
&& Objects.deepEquals(this.index, other.index)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf<Any?>(
|
|
43
|
+
text,
|
|
44
|
+
confidence,
|
|
45
|
+
index
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
companion object {
|
|
50
|
+
/**
|
|
51
|
+
* Constructor called from C++
|
|
52
|
+
*/
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
@Suppress("unused")
|
|
56
|
+
@JvmStatic
|
|
57
|
+
private fun fromCpp(text: String, confidence: Double, index: Double): ObjectLabel {
|
|
58
|
+
return ObjectLabel(text, confidence, index)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ObjectRect.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitromlkit.objects
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "ObjectRect".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class ObjectRect(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val x: Double,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val y: Double,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val width: Double,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val height: Double
|
|
33
|
+
) {
|
|
34
|
+
/* primary constructor */
|
|
35
|
+
|
|
36
|
+
override fun equals(other: Any?): Boolean {
|
|
37
|
+
if (this === other) return true
|
|
38
|
+
if (other !is ObjectRect) return false
|
|
39
|
+
return Objects.deepEquals(this.x, other.x)
|
|
40
|
+
&& Objects.deepEquals(this.y, other.y)
|
|
41
|
+
&& Objects.deepEquals(this.width, other.width)
|
|
42
|
+
&& Objects.deepEquals(this.height, other.height)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override fun hashCode(): Int {
|
|
46
|
+
return arrayOf<Any?>(
|
|
47
|
+
x,
|
|
48
|
+
y,
|
|
49
|
+
width,
|
|
50
|
+
height
|
|
51
|
+
).contentDeepHashCode()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
companion object {
|
|
55
|
+
/**
|
|
56
|
+
* Constructor called from C++
|
|
57
|
+
*/
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
@Keep
|
|
60
|
+
@Suppress("unused")
|
|
61
|
+
@JvmStatic
|
|
62
|
+
private fun fromCpp(x: Double, y: Double, width: Double, height: Double): ObjectRect {
|
|
63
|
+
return ObjectRect(x, y, width, height)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NitroMLKitObjects+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/NitroMLKitObjects+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 NitroMLKitObjects is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/NitroMLKitObjects-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
# Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
|
|
60
|
+
"SWIFT_INSTALL_OBJC_HEADER" => "NO",
|
|
61
|
+
})
|
|
62
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMLKitObjects-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "NitroMLKitObjects-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridObjectDetectorSpecSwift.hpp"
|
|
12
|
+
#include "NitroMLKitObjects-Swift-Cxx-Umbrella.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::mlkit::objects::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::function<void(const std::vector<DetectedObject>& /* result */)>
|
|
18
|
+
Func_void_std__vector_DetectedObject_ create_Func_void_std__vector_DetectedObject_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
+
auto swiftClosure = NitroMLKitObjects::Func_void_std__vector_DetectedObject_::fromUnsafe(swiftClosureWrapper);
|
|
20
|
+
return [swiftClosure = std::move(swiftClosure)](const std::vector<DetectedObject>& result) mutable -> void {
|
|
21
|
+
swiftClosure.call(result);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
26
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
+
auto swiftClosure = NitroMLKitObjects::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
28
|
+
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
29
|
+
swiftClosure.call(error);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::function<void(const std::vector<BatchObjectResult>& /* result */)>
|
|
34
|
+
Func_void_std__vector_BatchObjectResult_ create_Func_void_std__vector_BatchObjectResult_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
35
|
+
auto swiftClosure = NitroMLKitObjects::Func_void_std__vector_BatchObjectResult_::fromUnsafe(swiftClosureWrapper);
|
|
36
|
+
return [swiftClosure = std::move(swiftClosure)](const std::vector<BatchObjectResult>& result) mutable -> void {
|
|
37
|
+
swiftClosure.call(result);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// pragma MARK: std::shared_ptr<HybridObjectDetectorSpec>
|
|
42
|
+
std::shared_ptr<HybridObjectDetectorSpec> create_std__shared_ptr_HybridObjectDetectorSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
43
|
+
NitroMLKitObjects::HybridObjectDetectorSpec_cxx swiftPart = NitroMLKitObjects::HybridObjectDetectorSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
44
|
+
return std::make_shared<margelo::nitro::mlkit::objects::HybridObjectDetectorSpecSwift>(swiftPart);
|
|
45
|
+
}
|
|
46
|
+
void* NON_NULL get_std__shared_ptr_HybridObjectDetectorSpec_(std__shared_ptr_HybridObjectDetectorSpec_ cppType) {
|
|
47
|
+
std::shared_ptr<margelo::nitro::mlkit::objects::HybridObjectDetectorSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::mlkit::objects::HybridObjectDetectorSpecSwift>(cppType);
|
|
48
|
+
#ifdef NITRO_DEBUG
|
|
49
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
50
|
+
throw std::runtime_error("Class \"HybridObjectDetectorSpec\" is not implemented in Swift!");
|
|
51
|
+
}
|
|
52
|
+
#endif
|
|
53
|
+
NitroMLKitObjects::HybridObjectDetectorSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
54
|
+
return swiftPart.toUnsafe();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::mlkit::objects::bridge::swift
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMLKitObjects-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `BatchObjectResult` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::mlkit::objects { struct BatchObjectResult; }
|
|
13
|
+
// Forward declaration of `DetectedObject` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::mlkit::objects { struct DetectedObject; }
|
|
15
|
+
// Forward declaration of `HybridObjectDetectorSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::mlkit::objects { class HybridObjectDetectorSpec; }
|
|
17
|
+
// Forward declaration of `ObjectLabel` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::mlkit::objects { struct ObjectLabel; }
|
|
19
|
+
// Forward declaration of `ObjectRect` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::mlkit::objects { struct ObjectRect; }
|
|
21
|
+
|
|
22
|
+
// Forward declarations of Swift defined types
|
|
23
|
+
// Forward declaration of `HybridObjectDetectorSpec_cxx` to properly resolve imports.
|
|
24
|
+
namespace NitroMLKitObjects { class HybridObjectDetectorSpec_cxx; }
|
|
25
|
+
|
|
26
|
+
// Include C++ defined types
|
|
27
|
+
#include "BatchObjectResult.hpp"
|
|
28
|
+
#include "DetectedObject.hpp"
|
|
29
|
+
#include "HybridObjectDetectorSpec.hpp"
|
|
30
|
+
#include "ObjectLabel.hpp"
|
|
31
|
+
#include "ObjectRect.hpp"
|
|
32
|
+
#include <NitroModules/Promise.hpp>
|
|
33
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
34
|
+
#include <NitroModules/Result.hpp>
|
|
35
|
+
#include <exception>
|
|
36
|
+
#include <functional>
|
|
37
|
+
#include <memory>
|
|
38
|
+
#include <optional>
|
|
39
|
+
#include <string>
|
|
40
|
+
#include <vector>
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
44
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
45
|
+
*/
|
|
46
|
+
namespace margelo::nitro::mlkit::objects::bridge::swift {
|
|
47
|
+
|
|
48
|
+
// pragma MARK: std::vector<ObjectLabel>
|
|
49
|
+
/**
|
|
50
|
+
* Specialized version of `std::vector<ObjectLabel>`.
|
|
51
|
+
*/
|
|
52
|
+
using std__vector_ObjectLabel_ = std::vector<ObjectLabel>;
|
|
53
|
+
inline std::vector<ObjectLabel> create_std__vector_ObjectLabel_(size_t size) noexcept {
|
|
54
|
+
std::vector<ObjectLabel> vector;
|
|
55
|
+
vector.reserve(size);
|
|
56
|
+
return vector;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// pragma MARK: std::vector<DetectedObject>
|
|
60
|
+
/**
|
|
61
|
+
* Specialized version of `std::vector<DetectedObject>`.
|
|
62
|
+
*/
|
|
63
|
+
using std__vector_DetectedObject_ = std::vector<DetectedObject>;
|
|
64
|
+
inline std::vector<DetectedObject> create_std__vector_DetectedObject_(size_t size) noexcept {
|
|
65
|
+
std::vector<DetectedObject> vector;
|
|
66
|
+
vector.reserve(size);
|
|
67
|
+
return vector;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// pragma MARK: std::shared_ptr<Promise<std::vector<DetectedObject>>>
|
|
71
|
+
/**
|
|
72
|
+
* Specialized version of `std::shared_ptr<Promise<std::vector<DetectedObject>>>`.
|
|
73
|
+
*/
|
|
74
|
+
using std__shared_ptr_Promise_std__vector_DetectedObject___ = std::shared_ptr<Promise<std::vector<DetectedObject>>>;
|
|
75
|
+
inline std::shared_ptr<Promise<std::vector<DetectedObject>>> create_std__shared_ptr_Promise_std__vector_DetectedObject___() noexcept {
|
|
76
|
+
return Promise<std::vector<DetectedObject>>::create();
|
|
77
|
+
}
|
|
78
|
+
inline PromiseHolder<std::vector<DetectedObject>> wrap_std__shared_ptr_Promise_std__vector_DetectedObject___(std::shared_ptr<Promise<std::vector<DetectedObject>>> promise) noexcept {
|
|
79
|
+
return PromiseHolder<std::vector<DetectedObject>>(std::move(promise));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// pragma MARK: std::function<void(const std::vector<DetectedObject>& /* result */)>
|
|
83
|
+
/**
|
|
84
|
+
* Specialized version of `std::function<void(const std::vector<DetectedObject>&)>`.
|
|
85
|
+
*/
|
|
86
|
+
using Func_void_std__vector_DetectedObject_ = std::function<void(const std::vector<DetectedObject>& /* result */)>;
|
|
87
|
+
/**
|
|
88
|
+
* Wrapper class for a `std::function<void(const std::vector<DetectedObject>& / * result * /)>`, this can be used from Swift.
|
|
89
|
+
*/
|
|
90
|
+
class Func_void_std__vector_DetectedObject__Wrapper final {
|
|
91
|
+
public:
|
|
92
|
+
explicit Func_void_std__vector_DetectedObject__Wrapper(std::function<void(const std::vector<DetectedObject>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::vector<DetectedObject>& /* result */)>>(std::move(func))) {}
|
|
93
|
+
inline void call(std::vector<DetectedObject> result) const noexcept {
|
|
94
|
+
_function->operator()(result);
|
|
95
|
+
}
|
|
96
|
+
private:
|
|
97
|
+
std::unique_ptr<std::function<void(const std::vector<DetectedObject>& /* result */)>> _function;
|
|
98
|
+
} SWIFT_NONCOPYABLE;
|
|
99
|
+
Func_void_std__vector_DetectedObject_ create_Func_void_std__vector_DetectedObject_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
100
|
+
inline Func_void_std__vector_DetectedObject__Wrapper wrap_Func_void_std__vector_DetectedObject_(Func_void_std__vector_DetectedObject_ value) noexcept {
|
|
101
|
+
return Func_void_std__vector_DetectedObject__Wrapper(std::move(value));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
105
|
+
/**
|
|
106
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
107
|
+
*/
|
|
108
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
109
|
+
/**
|
|
110
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
111
|
+
*/
|
|
112
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
113
|
+
public:
|
|
114
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
115
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
116
|
+
_function->operator()(error);
|
|
117
|
+
}
|
|
118
|
+
private:
|
|
119
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
120
|
+
} SWIFT_NONCOPYABLE;
|
|
121
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
122
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
123
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// pragma MARK: std::optional<std::string>
|
|
127
|
+
/**
|
|
128
|
+
* Specialized version of `std::optional<std::string>`.
|
|
129
|
+
*/
|
|
130
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
131
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
132
|
+
return std::optional<std::string>(value);
|
|
133
|
+
}
|
|
134
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
135
|
+
return optional.has_value();
|
|
136
|
+
}
|
|
137
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
138
|
+
return optional.value();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// pragma MARK: std::vector<BatchObjectResult>
|
|
142
|
+
/**
|
|
143
|
+
* Specialized version of `std::vector<BatchObjectResult>`.
|
|
144
|
+
*/
|
|
145
|
+
using std__vector_BatchObjectResult_ = std::vector<BatchObjectResult>;
|
|
146
|
+
inline std::vector<BatchObjectResult> create_std__vector_BatchObjectResult_(size_t size) noexcept {
|
|
147
|
+
std::vector<BatchObjectResult> vector;
|
|
148
|
+
vector.reserve(size);
|
|
149
|
+
return vector;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// pragma MARK: std::shared_ptr<Promise<std::vector<BatchObjectResult>>>
|
|
153
|
+
/**
|
|
154
|
+
* Specialized version of `std::shared_ptr<Promise<std::vector<BatchObjectResult>>>`.
|
|
155
|
+
*/
|
|
156
|
+
using std__shared_ptr_Promise_std__vector_BatchObjectResult___ = std::shared_ptr<Promise<std::vector<BatchObjectResult>>>;
|
|
157
|
+
inline std::shared_ptr<Promise<std::vector<BatchObjectResult>>> create_std__shared_ptr_Promise_std__vector_BatchObjectResult___() noexcept {
|
|
158
|
+
return Promise<std::vector<BatchObjectResult>>::create();
|
|
159
|
+
}
|
|
160
|
+
inline PromiseHolder<std::vector<BatchObjectResult>> wrap_std__shared_ptr_Promise_std__vector_BatchObjectResult___(std::shared_ptr<Promise<std::vector<BatchObjectResult>>> promise) noexcept {
|
|
161
|
+
return PromiseHolder<std::vector<BatchObjectResult>>(std::move(promise));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// pragma MARK: std::function<void(const std::vector<BatchObjectResult>& /* result */)>
|
|
165
|
+
/**
|
|
166
|
+
* Specialized version of `std::function<void(const std::vector<BatchObjectResult>&)>`.
|
|
167
|
+
*/
|
|
168
|
+
using Func_void_std__vector_BatchObjectResult_ = std::function<void(const std::vector<BatchObjectResult>& /* result */)>;
|
|
169
|
+
/**
|
|
170
|
+
* Wrapper class for a `std::function<void(const std::vector<BatchObjectResult>& / * result * /)>`, this can be used from Swift.
|
|
171
|
+
*/
|
|
172
|
+
class Func_void_std__vector_BatchObjectResult__Wrapper final {
|
|
173
|
+
public:
|
|
174
|
+
explicit Func_void_std__vector_BatchObjectResult__Wrapper(std::function<void(const std::vector<BatchObjectResult>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::vector<BatchObjectResult>& /* result */)>>(std::move(func))) {}
|
|
175
|
+
inline void call(std::vector<BatchObjectResult> result) const noexcept {
|
|
176
|
+
_function->operator()(result);
|
|
177
|
+
}
|
|
178
|
+
private:
|
|
179
|
+
std::unique_ptr<std::function<void(const std::vector<BatchObjectResult>& /* result */)>> _function;
|
|
180
|
+
} SWIFT_NONCOPYABLE;
|
|
181
|
+
Func_void_std__vector_BatchObjectResult_ create_Func_void_std__vector_BatchObjectResult_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
182
|
+
inline Func_void_std__vector_BatchObjectResult__Wrapper wrap_Func_void_std__vector_BatchObjectResult_(Func_void_std__vector_BatchObjectResult_ value) noexcept {
|
|
183
|
+
return Func_void_std__vector_BatchObjectResult__Wrapper(std::move(value));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// pragma MARK: std::vector<std::string>
|
|
187
|
+
/**
|
|
188
|
+
* Specialized version of `std::vector<std::string>`.
|
|
189
|
+
*/
|
|
190
|
+
using std__vector_std__string_ = std::vector<std::string>;
|
|
191
|
+
inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
|
|
192
|
+
std::vector<std::string> vector;
|
|
193
|
+
vector.reserve(size);
|
|
194
|
+
return vector;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// pragma MARK: std::shared_ptr<HybridObjectDetectorSpec>
|
|
198
|
+
/**
|
|
199
|
+
* Specialized version of `std::shared_ptr<HybridObjectDetectorSpec>`.
|
|
200
|
+
*/
|
|
201
|
+
using std__shared_ptr_HybridObjectDetectorSpec_ = std::shared_ptr<HybridObjectDetectorSpec>;
|
|
202
|
+
std::shared_ptr<HybridObjectDetectorSpec> create_std__shared_ptr_HybridObjectDetectorSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
203
|
+
void* NON_NULL get_std__shared_ptr_HybridObjectDetectorSpec_(std__shared_ptr_HybridObjectDetectorSpec_ cppType);
|
|
204
|
+
|
|
205
|
+
// pragma MARK: std::weak_ptr<HybridObjectDetectorSpec>
|
|
206
|
+
using std__weak_ptr_HybridObjectDetectorSpec_ = std::weak_ptr<HybridObjectDetectorSpec>;
|
|
207
|
+
inline std__weak_ptr_HybridObjectDetectorSpec_ weakify_std__shared_ptr_HybridObjectDetectorSpec_(const std::shared_ptr<HybridObjectDetectorSpec>& strong) noexcept { return strong; }
|
|
208
|
+
|
|
209
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::vector<DetectedObject>>>>
|
|
210
|
+
using Result_std__shared_ptr_Promise_std__vector_DetectedObject____ = Result<std::shared_ptr<Promise<std::vector<DetectedObject>>>>;
|
|
211
|
+
inline Result_std__shared_ptr_Promise_std__vector_DetectedObject____ create_Result_std__shared_ptr_Promise_std__vector_DetectedObject____(const std::shared_ptr<Promise<std::vector<DetectedObject>>>& value) noexcept {
|
|
212
|
+
return Result<std::shared_ptr<Promise<std::vector<DetectedObject>>>>::withValue(value);
|
|
213
|
+
}
|
|
214
|
+
inline Result_std__shared_ptr_Promise_std__vector_DetectedObject____ create_Result_std__shared_ptr_Promise_std__vector_DetectedObject____(const std::exception_ptr& error) noexcept {
|
|
215
|
+
return Result<std::shared_ptr<Promise<std::vector<DetectedObject>>>>::withError(error);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::vector<BatchObjectResult>>>>
|
|
219
|
+
using Result_std__shared_ptr_Promise_std__vector_BatchObjectResult____ = Result<std::shared_ptr<Promise<std::vector<BatchObjectResult>>>>;
|
|
220
|
+
inline Result_std__shared_ptr_Promise_std__vector_BatchObjectResult____ create_Result_std__shared_ptr_Promise_std__vector_BatchObjectResult____(const std::shared_ptr<Promise<std::vector<BatchObjectResult>>>& value) noexcept {
|
|
221
|
+
return Result<std::shared_ptr<Promise<std::vector<BatchObjectResult>>>>::withValue(value);
|
|
222
|
+
}
|
|
223
|
+
inline Result_std__shared_ptr_Promise_std__vector_BatchObjectResult____ create_Result_std__shared_ptr_Promise_std__vector_BatchObjectResult____(const std::exception_ptr& error) noexcept {
|
|
224
|
+
return Result<std::shared_ptr<Promise<std::vector<BatchObjectResult>>>>::withError(error);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// pragma MARK: Result<bool>
|
|
228
|
+
using Result_bool_ = Result<bool>;
|
|
229
|
+
inline Result_bool_ create_Result_bool_(bool value) noexcept {
|
|
230
|
+
return Result<bool>::withValue(std::move(value));
|
|
231
|
+
}
|
|
232
|
+
inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
|
|
233
|
+
return Result<bool>::withError(error);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
} // namespace margelo::nitro::mlkit::objects::bridge::swift
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMLKitObjects-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `BatchObjectResult` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::mlkit::objects { struct BatchObjectResult; }
|
|
13
|
+
// Forward declaration of `DetectedObject` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::mlkit::objects { struct DetectedObject; }
|
|
15
|
+
// Forward declaration of `HybridObjectDetectorSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::mlkit::objects { class HybridObjectDetectorSpec; }
|
|
17
|
+
// Forward declaration of `ObjectLabel` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::mlkit::objects { struct ObjectLabel; }
|
|
19
|
+
// Forward declaration of `ObjectRect` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::mlkit::objects { struct ObjectRect; }
|
|
21
|
+
|
|
22
|
+
// Include C++ defined types
|
|
23
|
+
#include "BatchObjectResult.hpp"
|
|
24
|
+
#include "DetectedObject.hpp"
|
|
25
|
+
#include "HybridObjectDetectorSpec.hpp"
|
|
26
|
+
#include "ObjectLabel.hpp"
|
|
27
|
+
#include "ObjectRect.hpp"
|
|
28
|
+
#include <NitroModules/Promise.hpp>
|
|
29
|
+
#include <NitroModules/Result.hpp>
|
|
30
|
+
#include <exception>
|
|
31
|
+
#include <memory>
|
|
32
|
+
#include <optional>
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <vector>
|
|
35
|
+
|
|
36
|
+
// C++ helpers for Swift
|
|
37
|
+
#include "NitroMLKitObjects-Swift-Cxx-Bridge.hpp"
|
|
38
|
+
|
|
39
|
+
// Common C++ types used in Swift
|
|
40
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
41
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
42
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
43
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
44
|
+
|
|
45
|
+
// Forward declarations of Swift defined types
|
|
46
|
+
// Forward declaration of `HybridObjectDetectorSpec_cxx` to properly resolve imports.
|
|
47
|
+
namespace NitroMLKitObjects { class HybridObjectDetectorSpec_cxx; }
|
|
48
|
+
|
|
49
|
+
// Include Swift defined types
|
|
50
|
+
#if __has_include("NitroMLKitObjects-Swift.h")
|
|
51
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
52
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroMLKitObjects".
|
|
53
|
+
#include "NitroMLKitObjects-Swift.h"
|
|
54
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
55
|
+
#elif __has_include(<NitroMLKitObjects/NitroMLKitObjects-Swift.h>)
|
|
56
|
+
#include <NitroMLKitObjects/NitroMLKitObjects-Swift.h>
|
|
57
|
+
#else
|
|
58
|
+
#error NitroMLKitObjects's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroMLKitObjects", and try building the app first.
|
|
59
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMLKitObjectsAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "NitroMLKitObjects-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridObjectDetectorSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface NitroMLKitObjectsAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation NitroMLKitObjectsAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::mlkit::objects;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"ObjectDetector",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridObjectDetectorSpec> hybridObject = NitroMLKitObjects::NitroMLKitObjectsAutolinking::createObjectDetector();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|