Skip to content

Commit 8306d68

Browse files
committed
425_Gold-YOLO-Body-Head-Hand:Fixed class ID parsing.
1 parent 90a8c6e commit 8306d68

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

425_Gold-YOLO-Body-Head-Hand/demo/demo_goldyolo_onnx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,14 @@ def __postprocess(
202202

203203
if len(boxes_keep) > 0:
204204
for box, score in zip(boxes_keep, scores_keep):
205+
class_id = int(box[1])
205206
x_min = int(max(box[2], 0) * image_width / self.input_shapes[0][3])
206207
y_min = int(max(box[3], 0) * image_height / self.input_shapes[0][2])
207208
x_max = int(min(box[4], self.input_shapes[0][3]) * image_width / self.input_shapes[0][3])
208209
y_max = int(min(box[5], self.input_shapes[0][2]) * image_height / self.input_shapes[0][2])
209210

210211
result_boxes.append(
211-
[x_min, y_min, x_max, y_max]
212+
[x_min, y_min, x_max, y_max, class_id]
212213
)
213214
result_scores.append(
214215
score

425_Gold-YOLO-Body-Head-Hand/demo/demo_goldyolo_onnx_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,14 @@ def __postprocess(
204204

205205
if len(boxes_keep) > 0:
206206
for box, score in zip(boxes_keep, scores_keep):
207+
class_id = int(box[1])
207208
x_min = int(max(box[2], 0) * image_width / self.input_shapes[0][3])
208209
y_min = int(max(box[3], 0) * image_height / self.input_shapes[0][2])
209210
x_max = int(min(box[4], self.input_shapes[0][3]) * image_width / self.input_shapes[0][3])
210211
y_max = int(min(box[5], self.input_shapes[0][2]) * image_height / self.input_shapes[0][2])
211212

212213
result_boxes.append(
213-
[x_min, y_min, x_max, y_max]
214+
[x_min, y_min, x_max, y_max, class_id]
214215
)
215216
result_scores.append(
216217
score

0 commit comments

Comments
 (0)