Skip to content

Commit 45234d6

Browse files
committed
fix: forward->generate
1 parent bc75e3a commit 45234d6

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ ObjectDetection::postprocess(const std::vector<EValue> &tensors,
6565
return output;
6666
}
6767

68-
std::vector<Detection> ObjectDetection::forward(std::string imageSource,
69-
double detectionThreshold) {
68+
std::vector<Detection> ObjectDetection::generate(std::string imageSource,
69+
double detectionThreshold) {
7070
auto [inputTensor, originalSize] =
7171
imageprocessing::readImageToTensor(imageSource, getAllInputShapes()[0]);
7272

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class ObjectDetection : public BaseModel {
1717
public:
1818
ObjectDetection(const std::string &modelSource,
1919
std::shared_ptr<react::CallInvoker> callInvoker);
20-
std::vector<Detection> forward(std::string imageSource,
21-
double detectionThreshold);
20+
std::vector<Detection> generate(std::string imageSource,
21+
double detectionThreshold);
2222

2323
private:
2424
std::vector<Detection> postprocess(const std::vector<EValue> &tensors,

packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export class ObjectDetectionModule extends BaseNonStaticModule {
2222
): Promise<Detection[]> {
2323
if (this.nativeModule == null)
2424
throw new Error(getError(ETError.ModuleNotLoaded));
25-
return await this.nativeModule.forward(imageSource, detectionThreshold);
25+
return await this.nativeModule.generate(imageSource, detectionThreshold);
2626
}
2727
}

0 commit comments

Comments
 (0)