Skip to content

Commit

Permalink
fix: dont compute highest if nothing detected
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroIshida committed Dec 31, 2023
1 parent 6121b98 commit 13eacf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node_script/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def infer(self, msg: Image) -> InferenceRawResult:
scores = instances.scores.tolist()
class_indices = instances.pred_classes.tolist()

if self.node_config.output_highest:
if len(scores) > 0 and self.node_config.output_highest:
best_index = np.argmax(scores)
pred_masks = [pred_masks[best_index]]
scores = [scores[best_index]]
Expand Down

0 comments on commit 13eacf7

Please sign in to comment.