Building off pre existing yolov8n-pose.pt #25604
Replies: 4 comments 2 replies
|
👋 Hello @StatisticalHorse, thank you for your interest in Ultralytics 🚀! We recommend a visit to the Docs for new users, where you can find many Python and CLI usage examples and where many common questions may already be answered. For this custom pose-training ❓ question, please provide as much information as possible, including your dataset format, class and keypoint definitions, sample images with annotations, model configuration, training command, and training logs. Please also verify that your workflow follows our Tips for Best Training Results. If you are encountering unexpected keypoint behavior, please include a 🐛 minimum reproducible example so we can investigate it effectively. Join the Ultralytics community where it suits you best. For real-time chat, head to Discord 🎧. Prefer in-depth discussions? Check out Discourse. Or dive into threads on our Subreddit to share knowledge with the community. This is an automated response 🤖, and an Ultralytics engineer will also assist you soon. UpgradeUpgrade to the latest pip install -U ultralyticsEnvironmentsYOLO may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLO Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
|
Fine-tuning |
|
You can do this in one model, don't need two. The thing to understand is YOLOv8-pose has one keypoint skeleton (kpt_shape) for the whole model, it's not per class. So the fix isn't training separate pose heads per class. Build your dataset so non-human classes have their keypoints marked invisible. Keep kpt_shape: [17, 3] in your data.yaml, don't touch it. For your new non-human classes, still include 17 keypoint slots per label, but set visibility to 0 for all of them, x/y can just be 0 too. That tells the loss function to skip keypoint loss for those instances, they just get bbox + class loss. Fine-tune starting from yolov8n-pose.pt, not from scratch, so you keep the pretrained pose head for the human class and just extend nc for your new classes. That "projecting keypoints onto one side" thing you saw before sounds like exactly this problem. If your non-human instances had visibility not set to 0, or had garbage keypoint values instead of properly zeroed and invisible ones, the model tries to learn keypoint positions for objects with no consistent keypoint geometry, and it drags everything toward some averaged, degenerate solution. So: single model, single kpt_shape, mixed dataset where only the person class has real keypoint annotations and everything else has them zeroed and marked invisible. No need for two models. |
|
If you want to keep the existing human-pose estimation and add more information, I would first clarify whether the new outputs are object classes or additional keypoints. If they are additional body/keypoint locations, you should extend the pose dataset's You can still start from the pretrained So I would recommend:
If by "more classes" you mean completely different objects rather than additional keypoints, then that is a different setup: you would change the dataset |
Uh oh!
There was an error while loading. Please reload this page.
As the title says, I need to build another model that adds more classes to the nano pose model (and keeps the human pose recognition that it already has). I am trying to see if there is a way to do so, as when I did have a custom human recognition in my dataset it was projecting all the key points onto one side. I would prefer not to have to run 2 separate models for what I am working on. Thanks!
All reactions