Implemented from_yolo_nas for keypoints#1138
Conversation
* Missing batch image support
supervision/keypoint/core.py
Outdated
|
|
||
| xy = yolo_nas_results.prediction.poses[:, :, :2] | ||
| confidence = yolo_nas_results.prediction.poses[:, :, 2] | ||
| class_id = [0] * len(xy) |
There was a problem hiding this comment.
We should not include any information not included in the result object. If class_id and class_name are not there, we should not add them. YOLO NAS allows you to train a custom pose estimation model: https://www.youtube.com/watch?v=J83ZvWfxjoA, so we should not assume we will get people or all classes are the same.
There was a problem hiding this comment.
After a moderate attempt, I found no way to add class_names or labels when training a pose net for Yolo NAS. I've mocked the results by using a detections network.
* Still hardcoded ID to -1 and name to "" if not provided - this lets us stick to (n,) shape. * Found no way to add class_names to pose tracker, so used the response of YOLO NAS detection instead, to check what the response looks like.
|
Ready for review: I've removed hardcoding of The special fields for -1 match what we have in |
|
Hi @LinasKo 👋🏻, let's keep the The same applies to class names. If we don't have this value, simply don't include the key |
|
Done. Tested and Class names and IDs still appear when input has labels and names. |
|
Awesome! I tested as well. Merging! |
Description
Implementation of
from_yolo_nasfor KeyPoints.class_idarray entries are hardcoded to0;class_nameentries as"person". Results object from NAS has aclass_names, but it isNone. This seems to be set during training, and used in other model types. Let's revisit this after we decide how exactly we want to structureclass_idandclass_namesinKeyPoints.Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Prerequisites:
Test code:
Docs