Skip to content

Commit b3a9b89

Browse files
committed
Remove OD_live button
1 parent e4d7a61 commit b3a9b89

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

apps/computer-vision/app/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ export default function Home() {
3535
>
3636
<Text style={styles.buttonText}>Object Detection</Text>
3737
</TouchableOpacity>
38-
<TouchableOpacity
39-
style={styles.button}
40-
onPress={() => router.navigate('object_detection_live/')}
41-
>
42-
<Text style={styles.buttonText}>Object Detection Live</Text>
43-
</TouchableOpacity>
4438
<TouchableOpacity
4539
style={styles.button}
4640
onPress={() => router.navigate('instance_segmentation/')}

packages/react-native-executorch/common/rnexecutorch/models/instance_segmentation/BaseInstanceSegmentation.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cv::Size BaseInstanceSegmentation::modelInputSize() const {
4040
return VisionModel::modelInputSize();
4141
}
4242
const auto &shape = inputShapes[0];
43-
return cv::Size(shape[shape.size() - 2], shape[shape.size() - 1]);
43+
return {shape[shape.size() - 2], shape[shape.size() - 1]};
4444
}
4545

4646
std::vector<types::Instance> BaseInstanceSegmentation::runInference(
@@ -149,7 +149,7 @@ cv::Rect BaseInstanceSegmentation::computeMaskCropRect(
149149
int32_t my2 =
150150
std::min(maskSize.height, static_cast<int32_t>(std::ceil(my2F)));
151151

152-
return cv::Rect(mx1, my1, mx2 - mx1, my2 - my1);
152+
return {mx1, my1, mx2 - mx1, my2 - my1};
153153
}
154154

155155
cv::Rect BaseInstanceSegmentation::addPaddingToRect(const cv::Rect &rect,
@@ -159,7 +159,7 @@ cv::Rect BaseInstanceSegmentation::addPaddingToRect(const cv::Rect &rect,
159159
int32_t x2 = std::min(maskSize.width, rect.x + rect.width + 1);
160160
int32_t y2 = std::min(maskSize.height, rect.y + rect.height + 1);
161161

162-
return cv::Rect(x1, y1, x2 - x1, y2 - y1);
162+
return {x1, y1, x2 - x1, y2 - y1};
163163
}
164164

165165
cv::Mat BaseInstanceSegmentation::warpToOriginalResolution(
@@ -253,6 +253,12 @@ void BaseInstanceSegmentation::ensureMethodLoaded(
253253
"or 'forward_{inputSize}' for multi-method models.");
254254
}
255255

256+
if (!module_) {
257+
throw RnExecutorchError(RnExecutorchErrorCode::ModuleNotLoaded,
258+
"Model not loaded: Cannot load method '" +
259+
methodName + "'");
260+
}
261+
256262
if (currentlyLoadedMethod_ != methodName) {
257263
if (!currentlyLoadedMethod_.empty()) {
258264
module_->unload_method(currentlyLoadedMethod_);

0 commit comments

Comments
 (0)