Skip to content

Commit

Permalink
425_Gold-YOLO-Body-Head-Hand:Fixed class ID parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazuhito00 committed Nov 30, 2023
1 parent 90a8c6e commit 8306d68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion 425_Gold-YOLO-Body-Head-Hand/demo/demo_goldyolo_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,14 @@ def __postprocess(

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

result_boxes.append(
[x_min, y_min, x_max, y_max]
[x_min, y_min, x_max, y_max, class_id]
)
result_scores.append(
score
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ def __postprocess(

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

result_boxes.append(
[x_min, y_min, x_max, y_max]
[x_min, y_min, x_max, y_max, class_id]
)
result_scores.append(
score
Expand Down

0 comments on commit 8306d68

Please sign in to comment.