Giter VIP home page Giter VIP logo

Comments (4)

glenn-jocher avatar glenn-jocher commented on August 24, 2024 1

Hello @lbq779660843,

Thank you for providing the detailed information and the minimum reproducible example (MRE). This is very helpful for us to understand and investigate the issue you're encountering.

Review of Your Setup

  1. Package Versions: Your torch and ultralytics versions are up-to-date, which is great. This ensures compatibility and access to the latest features and bug fixes.

  2. Training Code: Your training setup looks comprehensive. Converting 'Silu' layers to 'Relu' for deployment compatibility is a valid approach, but it's worth noting that this change might affect the model's performance. If possible, you might want to compare the results with the original 'Silu' layers to see if there's a significant difference.

  3. Inference Code: Your inference code is straightforward and correctly utilizes the trained model for predictions.

Suggestions for Improvement

Here are a few suggestions to potentially improve the accuracy of the detected corner points:

  1. Data Augmentation: Ensure that your training data includes a variety of augmentations such as rotations, flips, and scaling. This can help the model generalize better to different scenarios.

  2. Hyperparameter Tuning: Experiment with different learning rates, batch sizes, and other hyperparameters. Sometimes, fine-tuning these can lead to significant improvements in model performance.

  3. Post-Processing: Implementing a post-processing step to refine the detected keypoints based on the bounding box can sometimes correct minor inaccuracies. For example, you could use a geometric transformation to adjust the keypoints relative to the detected bounding box.

  4. Loss Function: Verify that the loss function used for training is appropriately balancing the detection of bounding boxes and keypoints. Adjusting the weights of different components in the loss function might help.

Example Post-Processing Code

Here's an example of how you might implement a simple post-processing step to refine the detected keypoints:

import numpy as np

def refine_keypoints(bbox, keypoints):
    # Assuming bbox is in the format [x1, y1, x2, y2]
    # and keypoints is a list of [x, y] coordinates
    refined_keypoints = []
    for kp in keypoints:
        x, y = kp
        # Adjust keypoints based on the bounding box
        x = np.clip(x, bbox[0], bbox[2])
        y = np.clip(y, bbox[1], bbox[3])
        refined_keypoints.append([x, y])
    return refined_keypoints

# Example usage
bbox = [50, 50, 200, 200]
keypoints = [[30, 30], [220, 220], [100, 100], [150, 150]]
refined_keypoints = refine_keypoints(bbox, keypoints)
print(refined_keypoints)

Next Steps

Please try the above suggestions and see if they help improve the accuracy of the detected corner points. If the issue persists, feel free to share more details or any specific observations you have noticed during training or inference.

Thank you for your patience and collaboration. We're here to help you achieve the best results with your YOLOv8-Pose model! 😊

from ultralytics.

github-actions avatar github-actions commented on August 24, 2024

πŸ‘‹ Hello @lbq779660843, thank you for your interest in Ultralytics YOLOv8 πŸš€! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a πŸ› Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

from ultralytics.

glenn-jocher avatar glenn-jocher commented on August 24, 2024

Hello @lbq779660843,

Thank you for reaching out and providing detailed information about your issue with YOLOv8-Pose. It's great to see you're working on such an interesting application!

To help you more effectively, could you please provide a minimum reproducible code example? This will allow us to better understand the context and reproduce the issue on our end. You can find guidelines on how to create one here: Minimum Reproducible Example. This step is crucial for us to investigate and identify a potential solution.

Additionally, please ensure that you are using the latest versions of torch and ultralytics. You can upgrade your packages using the following commands:

pip install --upgrade torch
pip install --upgrade ultralytics

Here are a few suggestions that might help improve the accuracy of your corner point detections:

  1. Data Augmentation: Ensure your training data includes a variety of scenarios and augmentations to help the model generalize better. Techniques like rotation, scaling, and flipping can be particularly useful.

  2. Hyperparameter Tuning: Experiment with different learning rates, batch sizes, and other hyperparameters. Sometimes, fine-tuning these can lead to significant improvements in model performance.

  3. Loss Function: Verify that the loss function used for training is appropriately balancing the detection of bounding boxes and keypoints. Adjusting the weights of different components in the loss function might help.

  4. Post-Processing: Implementing a post-processing step to refine the detected keypoints based on the bounding box can sometimes correct minor inaccuracies.

  5. Model Architecture: Consider experimenting with different model architectures or additional layers that might better capture the spatial relationships between the keypoints and the bounding box.

If you could share more details about your training setup, such as the dataset, augmentation techniques, and any specific configurations, it would be very helpful.

Looking forward to your response!

from ultralytics.

lbq779660843 avatar lbq779660843 commented on August 24, 2024

@glenn-jocher
Thanks for your response. This is my MRE:

  1. This is my packages version:
    torch : 2.1.2
    ultralytics : 8.1.29

  2. This is my training code. By the way, I have converted all 'Silu' layers to 'Relu' layers during training time because I want to deploy the model on a board that doesn't support the 'Silu' operator.

from ultralytics import YOLO
model = YOLO('yolov8s-pose.pt')
results = model.train(data='hzm-pose-bev-v1_1.yaml', epochs=800, workers=4, batch=240, amp=False, device=[0, 1, 2, 3])
  1. This is my inference code.
from ultralytics import YOLO
# 'slot.pt' is the model trained by yolov8s-pose.pt
model = YOLO("slot.pt")
results = model.predict(source="test", save=True, save_txt=False)

PS. This is the model, config and test images download link.

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.