Skip to content

Commit 98395af

Browse files
fix: compilation JSI error
1 parent a9c01a9 commit 98395af

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

packages/react-native-executorch/common/rnexecutorch/metaprogramming/FunctionHelpers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ template <typename... Types, std::size_t... I>
2424
std::tuple<Types...> fillTupleFromArgs(std::index_sequence<I...>,
2525
const jsi::Value *args,
2626
jsi::Runtime &runtime) {
27-
return std::make_tuple(jsi_conversion::getValue<Types>(args[I], runtime)...);
27+
return std::tuple<Types...>{
28+
jsi_conversion::getValue<Types>(args[I], runtime)...};
2829
}
2930

3031
/**

packages/react-native-executorch/common/rnexecutorch/models/object_detection/ObjectDetection.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,9 @@ ObjectDetection::generateFromFrame(jsi::Runtime &runtime,
147147
}
148148

149149
std::vector<types::Detection>
150-
ObjectDetection::generateFromPixels(jsi::Runtime &runtime,
151-
const jsi::Value &pixelData,
150+
ObjectDetection::generateFromPixels(JSTensorViewIn pixelData,
152151
double detectionThreshold) {
153-
auto tensorView =
154-
jsi_conversion::getValue<JSTensorViewIn>(pixelData, runtime);
155-
cv::Mat image = extractFromPixels(tensorView);
152+
cv::Mat image = extractFromPixels(pixelData);
156153

157154
return runInference(image, detectionThreshold);
158155
}

packages/react-native-executorch/common/rnexecutorch/models/object_detection/ObjectDetection.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ class ObjectDetection : public VisionModel {
2626
generateFromFrame(jsi::Runtime &runtime, const jsi::Value &frameData,
2727
double detectionThreshold);
2828
[[nodiscard("Registered non-void function")]] std::vector<types::Detection>
29-
generateFromPixels(jsi::Runtime &runtime, const jsi::Value &pixelData,
30-
double detectionThreshold);
29+
generateFromPixels(JSTensorViewIn pixelData, double detectionThreshold);
3130

3231
protected:
3332
std::vector<types::Detection> runInference(cv::Mat image,

0 commit comments

Comments
 (0)