Skip to content

Commit

Permalink
Merge pull request ultralytics#41 from PulkitMishra/PulkitMishra-onnx…
Browse files Browse the repository at this point in the history
…_inference_fix

onnx inference visualisation fix
  • Loading branch information
debapriyamaji authored Aug 26, 2022
2 parents d1f43a0 + a411a06 commit ae4e0e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onnx_inference/yolo_pose_onnx_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def post_process(img_file, dst_file, output, score_threshold=0.3):
f.write("{:8.0f} {:8.5f} {:8.5f} {:8.5f} {:8.5f} {:8.5f}\n".format(det_labels[idx], det_scores[idx], det_bbox[1], det_bbox[0], det_bbox[3], det_bbox[2]))
if det_scores[idx]>score_threshold:
color_map = _CLASS_COLOR_MAP[int(det_labels[idx])]
img = cv2.rectangle(img, (det_bbox[0], det_bbox[1]), (det_bbox[2], det_bbox[3]), color_map[::-1], 2)
img = cv2.rectangle(img, (int(det_bbox[0]), int(det_bbox[1])), (int(det_bbox[2]), int(det_bbox[3])), color_map[::-1], 2)
cv2.putText(img, "id:{}".format(int(det_labels[idx])), (int(det_bbox[0]+5),int(det_bbox[1])+15), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_map[::-1], 2)
cv2.putText(img, "score:{:2.1f}".format(det_scores[idx]), (int(det_bbox[0] + 5), int(det_bbox[1]) + 30), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_map[::-1], 2)
plot_skeleton_kpts(img, kpt)
Expand Down Expand Up @@ -120,4 +120,4 @@ def main():
dst_path=args.dst_path)

if __name__== "__main__":
main()
main()

0 comments on commit ae4e0e8

Please sign in to comment.