Skip to content

Commit 5d09171

Browse files
committed
Update packages/react-native-executorch/common/rnexecutorch/models/object_detection/ObjectDetection.cpp
1 parent 1aaca9e commit 5d09171

File tree

1 file changed

+1
-1
lines changed
  • packages/react-native-executorch/common/rnexecutorch/models/object_detection

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ ObjectDetection::postprocess(const std::vector<EValue> &tensors,
127127
float x2 = bboxes[i * 4 + 2] * widthRatio;
128128
float y2 = bboxes[i * 4 + 3] * heightRatio;
129129

130-
if (static_cast<std::size_t>(labelIdx) >= labelNames_.size()) {
130+
if (std::cmp_greater(labelIdx, labelNames_.size()) {
131131
throw RnExecutorchError(
132132
RnExecutorchErrorCode::InvalidConfig,
133133
"Model output class index " + std::to_string(labelIdx) +

0 commit comments

Comments
 (0)