-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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
Add OpenVINO metadata to export #7947
Conversation
Write .yaml file automatically when exporting model to openvino to be used during inference
for more information, see https://pre-commit.ci
@xylieong this is a great idea! This should be added to DetectMultiBackend() also to load these during inference. |
@glenn-jocher Sure! Besides, I saw your commit, but would it be better that the yaml file name is based on the model name instead of 'metadata'? There might be possibility that different models exist in the same Path with different metadatas. |
@xylieong I've updated your PR and made the idea extensible to any other directory format like SavedModel and TF.js. If any of them have a meta.yaml in their directory it can now be loaded to retrieve stride and class names. |
@xylieong PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
Just saw this. Yes this is a good point. I'll make a new PR with this update. |
Great! |
* Write .yaml file when exporting model to openvino Write .yaml file automatically when exporting model to openvino to be used during inference * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update export.py * Update export.py * Load metadata on inference * Update common.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <[email protected]>
* Write .yaml file when exporting model to openvino Write .yaml file automatically when exporting model to openvino to be used during inference * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update export.py * Update export.py * Load metadata on inference * Update common.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <[email protected]>
@xylieong thank you! We really appreciate your feedback and suggestions. |
Write .yaml file automatically when exporting model to openvino to be used during inference
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Improved metadata handling for OpenVINO exports and model class name loading in YOLOv5.
📊 Key Changes
yaml
import for metadata handling.export_openvino
function to include the model parameter.meta.yaml
file with model stride and class names.__init__
method inmodels/common.py
no longer loads class names fromdata.yaml
directly._load_metadata
method inMultiBackend
class to load metadata frommeta.yaml
.🎯 Purpose & Impact