Skip to content

Commit 3c88267

Browse files
committed
Apply suggestions
1 parent 25e795c commit 3c88267

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,8 @@ std::vector<types::Instance> BaseInstanceSegmentation::postprocess(
332332

333333
auto isValidDetection =
334334
[&allowedClasses, &confidenceThreshold](float score, int32_t labelIdx) {
335-
if (score < confidenceThreshold) {
336-
return false;
337-
}
338-
if (!allowedClasses.empty() && allowedClasses.count(labelIdx) == 0) {
335+
if (score < confidenceThreshold ||
336+
(!allowedClasses.empty() && allowedClasses.count(labelIdx) == 0)) {
339337
return false;
340338
}
341339
return true;

0 commit comments

Comments
 (0)