Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The size of the model input causes prediction results problems #6062

Closed
1 task done
largestcabbage opened this issue Nov 1, 2023 · 3 comments
Closed
1 task done
Labels
question Further information is requested Stale

Comments

@largestcabbage
Copy link

Search before asking

Question

In model training, if the input size of the model is 1024 or 960, the defect location can be correctly predicted. However, when the input size of the model is 1280, the predicted boundary is smaller than the actual boundary.

Can I take a look at the predicted pictures
DL_101_RGB_1280
DL_101_RGB_1024

Additional

No response

@largestcabbage largestcabbage added the question Further information is requested label Nov 1, 2023
@largestcabbage
Copy link
Author

Hello, can this problem be solved? What is the specific reason?

@glenn-jocher
Copy link
Member

@largestcabbage hello,

Thank you for bringing this issue to our attention. The difference in bounding box sizes at varying input resolutions could be attributed to multiple factors. Primarily, there could be a disparity in how the network is interpreting features at different scales. This is not uncommon, especially when models are trained on one input size and then inferred on another.

Here are some steps you could take to mitigate the issue:

  1. Ensure Consistent Training and Inference Resolutions: If you trained your model at a lower resolution, try to keep the inference resolution the same or close to the training resolution where the model performs best.

  2. Re-visit Data Augmentation: Consider incorporating data augmentations that expose the model to a variety of scales during training. This helps the model learn size invariance and improves its ability to generalize over different input sizes.

  3. Fine-tuning: You may fine-tune your model on a higher resolution if that's your intended use case. Starting from the weights learned at a lower resolution and continuing the training at the higher resolution can help the model adjust better.

  4. Evaluate Anchor Sizes: If you have significant control over the architecture choices, review the anchor box sizes. Sometimes, anchor boxes may not align well with the scale of objects at different resolutions.

  5. Post-processing Adjustments: Adjust the non-maximum suppression (NMS) threshold and confidence thresholds during inference to see if that helps fit the bounding boxes more accurately.

  6. Inspect Training Data: Ensure your training data is representative of the resolution at which you wish to perform inference. The model's performance can degrade if there's a large discrepancy.

Keep in mind that each model may respond differently to changes in input resolution, and the adjustments may require some experimentation to identify what works best for your specific scenario. Feel free to experiment with these steps and observe which combination gives you the improved results at your desired inference resolution.

Best regards,
The Ultralytics Team

Copy link

github-actions bot commented Dec 8, 2023

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

2 participants