-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Modify Inference Results Print Output #11488
Comments
👋 Hello @jmurel, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. 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. RequirementsPython>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 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 YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Introducing YOLOv8 🚀We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀! Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects. Check out our YOLOv8 Docs for details and get started with: pip install ultralytics |
@jmurel hello!
Hope this helps! |
@glenn-jocher Thank you very much for your help! I needed to modify the first script a bit, as it returned some errors, but it worked after the modification. In case anyone else here is interested, I'm including the modified script snippet below:
The second script, however, has left me more perplexed. It works w/out terminal errors, but the script seems to be miscounting (or at least misprinting). For example, when running the model on a small test thirteen-image set, it prints the following results:
Although the model has identified one image as containing the object (i.e. marginalia), the script reports 0 images. I've tried toying a bit with the script excerpt provided by @glenn-jocher but nothing has worked yet. I thought I would leave a comment in case they or anyone else has thoughts on what the issue may be. |
@jmurel, thank you for the update and glad that the modified script snippet worked for you. Regarding the second script, it seems like the issue might be due to the fact that you're looking for a specific label ('marginalia') within the detections, but the label might not be exactly the same as what you're looking for. Here's a modified version of the snippet that should work:
This modified version checks if the detected label starts with 'marginalia' (using Hopefully this helps! Let me know if there are still any issues. |
@glenn-jocher Thank you for this!
I've tried looking around online, bu can't find much on how to resolve this. Might you have any suggestions to point me in the right direction? |
@jmurel Sorry for the confusion - it looks like the detections are actually tensors, not strings, so we can't use string methods like Instead, we can convert the label to a tensor and use PyTorch methods to perform the check. Here's the modified snippet:
This snippet first converts the label to a tensor ( Note that this snippet assumes that |
@glenn-jocher When I run this script, it returns:
I've been trying to troubleshoot, but can't seem to get it right. Do you have any thoughts? |
@jmurel hello, It looks like the error is being caused because the label ('marginalia') is not found in the However, the label should actually be found in the
This should allow the script to run without errors. Let me know if you have any further questions or issues! |
👋 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 ⭐ |
Search before asking
Question
I have a custom-trained model I am currently inferring on several hundred images in a given directory. This is my command:
This command/script itself works fine; at the moment, there are no issues. Per 'results.print()', it returns the following:
My question is how to modify the output from results.print(). There are two modifications in which I am interested:
Any information you can provide is appreciated!
Additional
No response
The text was updated successfully, but these errors were encountered: