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

Getting unexpred shape from model output #613

Closed
1 task done
skj092 opened this issue Mar 16, 2024 · 5 comments
Closed
1 task done

Getting unexpred shape from model output #613

skj092 opened this issue Mar 16, 2024 · 5 comments
Labels
question A HUB question that does not involve a bug Stale

Comments

@skj092
Copy link

skj092 commented Mar 16, 2024

Search before asking

Question

I have trained a yolov8 model on ultralytics hub, after training I have exported the model to onnx format. While inferencing locally I am getting output shape from the model as (5x8400), I have trained the model for one classes. How to get the bounding box co-ordinate from the array ?

Additional

No response

@skj092 skj092 added the question A HUB question that does not involve a bug label Mar 16, 2024
Copy link

👋 Hello @skj092, thank you for raising an issue about Ultralytics HUB 🚀! Please visit our HUB Docs to learn more:

  • Quickstart. Start training and deploying YOLO models with HUB in seconds.
  • Datasets: Preparing and Uploading. Learn how to prepare and upload your datasets to HUB in YOLO format.
  • Projects: Creating and Managing. Group your models into projects for improved organization.
  • Models: Training and Exporting. Train YOLOv5 and YOLOv8 models on your custom datasets and export them to various formats for deployment.
  • Integrations. Explore different integration options for your trained models, such as TensorFlow, ONNX, OpenVINO, CoreML, and PaddlePaddle.
  • Ultralytics HUB App. Learn about the Ultralytics App for iOS and Android, which allows you to run models directly on your mobile device.
    • iOS. Learn about YOLO CoreML models accelerated on Apple's Neural Engine on iPhones and iPads.
    • Android. Explore TFLite acceleration on mobile devices.
  • Inference API. Understand how to use the Inference API for running your trained models in the cloud to generate predictions.

If this is a 🐛 Bug Report, please provide screenshots and steps to reproduce your problem to help us get started working on a fix.

If this is a ❓ Question, please provide as much information as possible, including dataset, model, environment details etc. so that we might provide the most helpful response.

We try to respond to all issues as promptly as possible. Thank you for your patience!

@UltralyticsAssistant
Copy link
Member

@skj092 hey there! 😊

It sounds like you're making great progress with your YOLOv8 model. When you receive an output shape like (5x8400) after exporting to ONNX and running inference, this array typically consists of detection information structured as follows: for every detected object, you have 5 values - the confidence score, followed by the 4 bounding box coordinates (x_center, y_center, width, height).

To extract the bounding box coordinates from this array, you'll want to iterate over your detections. For each detection, you'll use the last 4 values of each sub-array as the bounding box coordinates. Remember, these coordinates are usually normalized, so you might need to scale them according to your image dimensions to get the actual pixel values.

If anything is unclear, or you need further assistance, feel free to ask. Keep up the good work!

For detailed info on handling outputs and more, do check our docs at https://docs.ultralytics.com/hub.

@skj092
Copy link
Author

skj092 commented Mar 17, 2024

Thanks,

@UltralyticsAssistant
Copy link
Member

@skj092 i'm here to help, but per the guidelines provided, I can't offer a reply in this scenario. If you have any other questions or need further assistance with Ultralytics HUB, please refer to our documentation at https://docs.ultralytics.com/hub or ask more questions here. Happy to help where I can! 😊

Copy link

👋 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 ⭐

@github-actions github-actions bot added the Stale label Apr 17, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A HUB question that does not involve a bug Stale
Projects
None yet
Development

No branches or pull requests

2 participants