Skip to content

Commit e454d49

Browse files
chore: image_segmentation -> semantic_segmentation - namespace
1 parent da8b9ee commit e454d49

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

packages/react-native-executorch/common/rnexecutorch/host_objects/JsiConversions.h

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

33
#include <codecvt>
44
#include <cstdint>
5-
#include <rnexecutorch/models/semantic_segmentation/Types.h>
65
#include <set>
76
#include <span>
87
#include <type_traits>
@@ -18,6 +17,7 @@
1817
#include <rnexecutorch/metaprogramming/TypeConcepts.h>
1918
#include <rnexecutorch/models/object_detection/Types.h>
2019
#include <rnexecutorch/models/ocr/Types.h>
20+
#include <rnexecutorch/models/semantic_segmentation/Types.h>
2121
#include <rnexecutorch/models/speech_to_text/types/Segment.h>
2222
#include <rnexecutorch/models/speech_to_text/types/TranscriptionResult.h>
2323
#include <rnexecutorch/models/style_transfer/Types.h>
@@ -582,7 +582,8 @@ getJsiValue(const models::style_transfer::PixelDataResult &result,
582582
}
583583

584584
inline jsi::Value getJsiValue(
585-
const rnexecutorch::models::image_segmentation::SegmentationResult &result,
585+
const rnexecutorch::models::semantic_segmentation::SegmentationResult
586+
&result,
586587
jsi::Runtime &runtime) {
587588
jsi::Object dict(runtime);
588589

packages/react-native-executorch/common/rnexecutorch/models/semantic_segmentation/BaseSemanticSegmentation.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ std::shared_ptr<jsi::Object> BaseSemanticSegmentation::generate(
7979
return populateDictionary(result.argmax, result.classBuffers);
8080
}
8181

82-
image_segmentation::SegmentationResult
82+
semantic_segmentation::SegmentationResult
8383
BaseSemanticSegmentation::generateFromFrame(
8484
jsi::Runtime &runtime, const jsi::Value &frameData,
8585
std::set<std::string, std::less<>> classesOfInterest, bool resize) {
@@ -106,7 +106,8 @@ BaseSemanticSegmentation::generateFromFrame(
106106
allClasses_, classesOfInterest, resize);
107107
}
108108

109-
image_segmentation::SegmentationResult BaseSemanticSegmentation::computeResult(
109+
semantic_segmentation::SegmentationResult
110+
BaseSemanticSegmentation::computeResult(
110111
const Tensor &tensor, cv::Size originalSize,
111112
std::vector<std::string> &allClasses,
112113
std::set<std::string, std::less<>> &classesOfInterest, bool resize) {
@@ -215,7 +216,7 @@ image_segmentation::SegmentationResult BaseSemanticSegmentation::computeResult(
215216
}
216217
}
217218

218-
return image_segmentation::SegmentationResult{argmax, buffersToReturn};
219+
return semantic_segmentation::SegmentationResult{argmax, buffersToReturn};
219220
}
220221

221222
std::shared_ptr<jsi::Object> BaseSemanticSegmentation::populateDictionary(

packages/react-native-executorch/common/rnexecutorch/models/semantic_segmentation/BaseSemanticSegmentation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ class BaseSemanticSegmentation : public VisionModel {
3636
// Must NOT use callInvoker — returns a plain SegmentationResult that
3737
// visionHostFunction converts to JSI via getJsiValue.
3838
[[nodiscard("Registered non-void function")]]
39-
image_segmentation::SegmentationResult
39+
semantic_segmentation::SegmentationResult
4040
generateFromFrame(jsi::Runtime &runtime, const jsi::Value &frameData,
4141
std::set<std::string, std::less<>> classesOfInterest,
4242
bool resize);
4343

4444
protected:
45-
virtual image_segmentation::SegmentationResult
45+
virtual semantic_segmentation::SegmentationResult
4646
computeResult(const Tensor &tensor, cv::Size originalSize,
4747
std::vector<std::string> &allClasses,
4848
std::set<std::string, std::less<>> &classesOfInterest,

packages/react-native-executorch/common/rnexecutorch/models/semantic_segmentation/Types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <string>
66
#include <unordered_map>
77

8-
namespace rnexecutorch::models::image_segmentation {
8+
namespace rnexecutorch::models::semantic_segmentation {
99

1010
struct SegmentationResult {
1111
std::shared_ptr<OwningArrayBuffer> argmax;
@@ -14,4 +14,4 @@ struct SegmentationResult {
1414
classBuffers;
1515
};
1616

17-
} // namespace rnexecutorch::models::image_segmentation
17+
} // namespace rnexecutorch::models::semantic_segmentation

0 commit comments

Comments
 (0)