# Handling keypoint classes

**URL:** <https://discuss.roboflow.com/t/handling-keypoint-classes/6956>\
**Category:** 🛠️ Feature Reqs\
**Tags:** feature-request\
**Created:** [September 4, 2024, 5:39am UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956 "2024-09-04T05:39:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hart\_Woolery](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/hart_woolery/32/2586_2.png) [@Hart\_Woolery](https://discuss.roboflow.com/u/Hart_Woolery)\
**Post date:** [September 4, 2024, 5:39am UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/1 "2024-09-04T05:39:29Z")

</div>

Currently the keypoint classes allow you to create n-classes-to-n-skeleton datasets. However, most keypoint models probably require n-classes-to-one-skeleton datasets. For example, if you wanted to classify exercise poses for a human you’d have to create a separate duplicate skeleton for each pose. And even then, I’m not sure you’d easily be able to change the class inside the annotator without reseting the points.

---

<div class="post-metadata">

**Author:** ![Jacob\_Witt](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jacob_witt/32/347_2.png) [@Jacob\_Witt](https://discuss.roboflow.com/u/Jacob_Witt)\
**Post date:** [September 4, 2024, 11:26am UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/2 "2024-09-04T11:26:28Z")

</div>

Thanks @Hart_Woolery!

Would love to explore this a bit more. Do you mind sharing what model you’re training?

While we don’t offer n-classes-to-one-skeleton datasets at present, what I’ve seen most customers do is calculate angles (or run a model on skeleton points) to classify poses.

---

<div class="post-metadata">

**Author:** ![Hart\_Woolery](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/hart_woolery/32/2586_2.png) [@Hart\_Woolery](https://discuss.roboflow.com/u/Hart_Woolery)\
**Post date:** [September 4, 2024, 2:44pm UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/3 "2024-09-04T14:44:16Z")

</div>

I’m training a yolov8-pose model, to detect both the racing team and keypoints for F1 cars. What I have to do currently is train a separate detection model, run my pose data through it, clean up the classification, then re-upload the dataset somewhere, which is a somewhat lengthy workaround : )

I think the classes could be abstracted completely from the keypoints in order to solve this issue. Then skeletons could be selected from a separate control during annotation.

---

<div class="post-metadata">

**Author:** ![Jacob\_Witt](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jacob_witt/32/347_2.png) [@Jacob\_Witt](https://discuss.roboflow.com/u/Jacob_Witt)\
**Post date:** [September 4, 2024, 7:35pm UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/4 "2024-09-04T19:35:30Z")

</div>

How many classes do you have? Would this be solved with some ability to duplicate the same skeleton structure when configuring new classes?

---

<div class="post-metadata">

**Author:** ![Hart\_Woolery](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/hart_woolery/32/2586_2.png) [@Hart\_Woolery](https://discuss.roboflow.com/u/Hart_Woolery)\
**Post date:** [September 4, 2024, 8:47pm UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/5 "2024-09-04T20:47:15Z")

</div>

I have one class per F1 team (10) and could possibly extend to one per driver (20). While duplicating the skeletons might help in the interim, it presents a few possible issues:

1. Modifying or deleting points from one skeleton would not affect the rest
2. If somebody mislabeled the class while annotating and then changed it, would it reset the keypoints?
3. Would the output layer have num\_keypoints \* num\_skeletons or just num\_keypoints? Ideally the the latter to allow the model to dedicate more weights toward each keypoint.

I think a way that would encapsulate all possible scenarios is to allow any skeleton to be any class. I think you could migrate to this without changing any existing data, though I’m sure there’s challenges I haven’t thought of.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/brad/32/23_2.png) [@brad](https://discuss.roboflow.com/u/brad)\
**Post date:** [September 5, 2024, 10:08pm UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/6 "2024-09-05T22:08:17Z")

</div>

1. Yeah that’d be a limitation unfortunately – how often would you need to change the skeleton once it’s setup?
2. No if the skeletons match they should propagate; let me know if this isn’t working properly
3. I’m not sure I follow here; I think YOLOv8-pose requires the same number of keypoints on each skeleton (if you have multiple you have to pad the ones with less points). They’d all have num\_keypoints points.

> I think a way that would encapsulate all possible scenarios is to allow any skeleton to be any class.

How would you communicate that to the model?

---

<div class="post-metadata">

**Author:** ![Hart\_Woolery](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/hart_woolery/32/2586_2.png) [@Hart\_Woolery](https://discuss.roboflow.com/u/Hart_Woolery)\
**Post date:** [September 5, 2024, 10:25pm UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/7 "2024-09-05T22:25:05Z")

</div>

Ok thanks for clarifying…

1. Probably not often
2. Great!
3. Yes, was just curious if creating more duplicate skeletons would result in padding the keypoints for the other skeletons, but sounds like no.

It sounds like based on 3 that it should work as needed, so ignore my last thought there

---

<div class="post-metadata">

**Author:** ![brad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/brad/32/23_2.png) [@brad](https://discuss.roboflow.com/u/brad)\
**Post date:** [September 5, 2024, 11:52pm UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/8 "2024-09-05T23:52:18Z")

</div>

Awesome lmk if you encounter any bugs. I put creating a “duplicate skeleton” option on my list to make that much easier (currently would have to be done manually)

---

<div class="post-metadata">

**Author:** ![Martin\_Perosa](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/martin_perosa/32/5477_2.png) [@Martin\_Perosa](https://discuss.roboflow.com/u/Martin_Perosa)\
**Post date:** [September 16, 2024, 10:19am UTC](https://discuss.roboflow.com/t/handling-keypoint-classes/6956/9 "2024-09-16T10:19:29Z")

</div>

I tried changing the class in my case, where I have three classes with the same skeleton, but the keypoints still reset. In this [discussion](https://discuss.roboflow.com/t/issues-with-keypoints-visibility-and-class-changes-in-roboflow/7057/2), I also provided a video demonstration.
