Skip to content

Commit ec452cc

Browse files
committed
bug fix in OVEP csharp sample
1 parent aadb8fc commit ec452cc

File tree

1 file changed

+13
-10
lines changed
  • c_sharp/OpenVINO_EP/yolov3_object_detection

1 file changed

+13
-10
lines changed

c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,20 @@ static void Main(string[] args)
133133
for (int i = 0; i < indices.Length; i = i + 3)
134134
{
135135
out_classes[count] = indices[i + 1];
136-
out_scores[count] = scores[indices[i], indices[i + 1], indices[i + 2]];
137-
predictions.Add(new Prediction
136+
if (indices[i + 1] > -1)
138137
{
139-
Box = new Box(boxes[indices[i], indices[i + 2], 1],
140-
boxes[indices[i], indices[i + 2], 0],
141-
boxes[indices[i], indices[i + 2], 3],
142-
boxes[indices[i], indices[i + 2], 2]),
143-
Class = LabelMap.Labels[out_classes[count]],
144-
Score = out_scores[count]
145-
});
146-
count++;
138+
out_scores[count] = scores[indices[i], indices[i + 1], indices[i + 2]];
139+
predictions.Add(new Prediction
140+
{
141+
Box = new Box(boxes[indices[i], indices[i + 2], 1],
142+
boxes[indices[i], indices[i + 2], 0],
143+
boxes[indices[i], indices[i + 2], 3],
144+
boxes[indices[i], indices[i + 2], 2]),
145+
Class = LabelMap.Labels[out_classes[count]],
146+
Score = out_scores[count]
147+
});
148+
count++;
149+
}
147150
}
148151

149152
// Put boxes, labels and confidence on image and save for viewing

0 commit comments

Comments
 (0)