Skip to content

Commit acbd25b

Browse files
committed
feat: port object detection to C++
1 parent 3df12b7 commit acbd25b

25 files changed

Lines changed: 223 additions & 592 deletions

File tree

packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/ObjectDetection.kt

Lines changed: 0 additions & 64 deletions
This file was deleted.

packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/RnExecutorchPackage.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class RnExecutorchPackage : TurboReactPackage() {
2020
ETModule(reactContext)
2121
} else if (name == Classification.NAME) {
2222
Classification(reactContext)
23-
} else if (name == ObjectDetection.NAME) {
24-
ObjectDetection(reactContext)
2523
} else if (name == SpeechToText.NAME) {
2624
SpeechToText(reactContext)
2725
} else if (name == OCR.NAME) {
@@ -73,17 +71,6 @@ class RnExecutorchPackage : TurboReactPackage() {
7371
true,
7472
)
7573

76-
moduleInfos[ObjectDetection.NAME] =
77-
ReactModuleInfo(
78-
ObjectDetection.NAME,
79-
ObjectDetection.NAME,
80-
false, // canOverrideExistingModule
81-
false, // needsEagerInit
82-
true, // hasConstants
83-
false, // isCxxModule
84-
true,
85-
)
86-
8774
moduleInfos[SpeechToText.NAME] =
8875
ReactModuleInfo(
8976
SpeechToText.NAME,

packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/models/objectDetection/SSDLiteLargeModel.kt

Lines changed: 0 additions & 74 deletions
This file was deleted.

packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/utils/ObjectDetectionUtils.kt

Lines changed: 0 additions & 201 deletions
This file was deleted.

packages/react-native-executorch/common/rnexecutorch/RnExecutorchInstaller.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <rnexecutorch/host_objects/JsiConversions.h>
44
#include <rnexecutorch/models/image_segmentation/ImageSegmentation.h>
5+
#include <rnexecutorch/models/object_detection/ObjectDetection.h>
56
#include <rnexecutorch/models/style_transfer/StyleTransfer.h>
67

78
namespace rnexecutorch {
@@ -25,5 +26,10 @@ void RnExecutorchInstaller::injectJSIBindings(
2526
*jsiRuntime, "loadImageSegmentation",
2627
RnExecutorchInstaller::loadModel<ImageSegmentation>(
2728
jsiRuntime, jsCallInvoker, "loadImageSegmentation"));
29+
30+
jsiRuntime->global().setProperty(
31+
*jsiRuntime, "loadObjectDetection",
32+
RnExecutorchInstaller::loadModel<ObjectDetection>(
33+
jsiRuntime, jsCallInvoker, "loadObjectDetection"));
2834
}
2935
} // namespace rnexecutorch

0 commit comments

Comments
 (0)