Comments (4)
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
-
Package Versions: Your
torch
andultralytics
versions are up-to-date, which is great. This ensures compatibility and access to the latest features and bug fixes. -
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.
-
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:
-
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.
-
Hyperparameter Tuning: Experiment with different learning rates, batch sizes, and other hyperparameters. Sometimes, fine-tuning these can lead to significant improvements in model performance.
-
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.
-
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.
π 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):
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
Status
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.
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:
-
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.
-
Hyperparameter Tuning: Experiment with different learning rates, batch sizes, and other hyperparameters. Sometimes, fine-tuning these can lead to significant improvements in model performance.
-
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.
-
Post-Processing: Implementing a post-processing step to refine the detected keypoints based on the bounding box can sometimes correct minor inaccuracies.
-
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.
@glenn-jocher
Thanks for your response. This is my MRE:
-
This is my packages version:
torch : 2.1.2
ultralytics : 8.1.29 -
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])
- 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)
- UserWarning: Grad strides do not match bucket view strides. This may indicate grad was not created according to the gradient layout contract, or that the param's strides changed since DDP was constructed. This is not an error, but may impair performance. grad.sizes() = [2, 64, 1, 1], strides() = [64, 1, 64, 64] bucket_view.sizes() = [2, 64, 1, 1], strides() = [64, 1, 1, 1] (Triggered internally at ../torchrc/distributed/c10d/reducer.cpp:325.) Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass HOT 2
- Using Unity Sentis for Segmentation Model Only for Human HOT 2
- yolov8 for web-camera use to classification HOT 3
- Weights combining HOT 6
- I am getting error! Help Me to Fix it i am confused HOT 3
- export yolov8 format HOT 10
- RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by passing the keyword argument `find_unused_parameters=True` to `torch.nn.parallel.DistributedDataParallel`, and by [rank0]: making sure all `forward` function outputs participate in calculating loss. HOT 2
- can not find the data correctly when use DDP train HOT 3
- Hybrid agnostic NMS HOT 7
- How do I correctly interpret and use the output from the OBB version of Yolov8 for 360ΒΊ prediction? HOT 9
- False Positive of YOLOv8 for Object Detection HOT 2
- TypeError: object of type 'int' has no len() HOT 2
- model not get optimized HOT 6
- gradio supports real-time detection of images captured in the camera. HOT 4
- Yolov8 trains 100 epochs on the coco8 dataset with a map of 0 HOT 6
- Problem with ONNX model HOT 12
- cls_loss and dfl_loss suddenly spike in the last 10 epochs HOT 4
- Training yolov9-seg Times Error HOT 3
- Precision Recall Curve HOT 4
- Split model size HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultralytics.