本文主要是介绍yolov8 pose keypoint解读,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
yolov8进行关键点检测的代码如下:
from ultralytics import YOLO# Load a model
model = YOLO('yolov8n.pt') # pretrained YOLOv8n model# Run batched inference on a list of images
results = model(['im1.jpg', 'im2.jpg']) # return a list of Results objects# Process results list
for result in results:boxes = result.boxes # Boxes object for bounding box outputsmasks = result.masks # Masks object for segmentation masks outputskeypoints = result.keypoints # Keypoints object for pose outputsprobs = result.probs # Probs object for classification outputsresult.show() # display to screenresult.save(filename='result.jpg') # save to disk
输出的keypoint顺序如下:
“keypoints”: [“nose”,“left_eye”,“right_eye”,“left_ear”,“right_ear”,“left_shoulder”,“right_shoulder”,“left_elbow”,“right_elbow”,“left_wrist”,“right_wrist”,“left_hip”,“right_hip”,“left_knee”,“right_knee”,“left_ankle”,“right_ankle”],
对两张图进行测试:
:
对应的输出格式如下,没有检测到的为(0,0):
第二张图片
这篇关于yolov8 pose keypoint解读的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!