test02.py 446 B

123456789101112131415
  1. from ultralytics import YOLO
  2. # Load a model
  3. model = YOLO(r"C:\Code\ML\Model\yolo26n-pose.pt") # load an official model
  4. # Predict with the model
  5. results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
  6. # Access the results
  7. for result in results:
  8. xy = result.keypoints.xy # x and y coordinates
  9. xyn = result.keypoints.xyn # normalized
  10. kpts = result.keypoints.data # x, y, visibility (if available)
  11. print()