Skip to content

Commit

Permalink
Merge pull request #4 from Jv82/patch-1
Browse files Browse the repository at this point in the history
Update onnx_inf.py
  • Loading branch information
Peterande authored Oct 21, 2024
2 parents eed6df6 + 2f614e9 commit b27b1d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/inference/onnx_inf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def draw(images, labels, boxes, scores, thrh = 0.6):
lab = labels[i][scr > thrh]
box = boxes[i][scr > thrh]

for b in box:
draw.rectangle(list(b), outline='red',)
draw.text((b[0], b[1]), text=str(lab[i].item()), fill='blue', )
for lbl, bb in zip(lab, box):
draw.rectangle(list(bb), outline='red',)
draw.text((bb[0], bb[1]), text=str(lbl), fill='blue', )

im.save(f'results_{i}.jpg')

Expand Down Expand Up @@ -60,4 +60,4 @@ def main(args, ):
parser.add_argument('--im-file', type=str, )
# parser.add_argument('-d', '--device', type=str, default='cpu')
args = parser.parse_args()
main(args)
main(args)

0 comments on commit b27b1d8

Please sign in to comment.