roboflow-python icon indicating copy to clipboard operation
roboflow-python copied to clipboard

Result of `model.predict` has type `ClassificationModel`, no keypoints.

Open LinasKo opened this issue 1 year ago • 0 comments

Tested on several projects:

  • Glue tube keypoints: https://app.roboflow.com/model-examples/glue-tube-keypoints
  • Football pitch recognition below.
pip install supervision roboflow
version = rf.workspace("roboflow-jvuqo").project("football-field-detection-f07vi").version(8)
version.download("yolov8")
kp_model = version.model
assert kp_model is not None

first_image_path = os.listdir(f"{dataset.location}/train/images")[0]
first_image_path = f"{dataset.location}/train/images/{first_image_path}"

result = kp_model.predict(first_image_path).json()

# Fails
keypoints = sv.KeyPoints.from_inference(result)

LinasKo avatar Dec 02 '24 16:12 LinasKo