ultralytics / yolo-flutter-app

A Flutter plugin for Ultralytics YOLO computer vision models
https://ultralytics.com
GNU Affero General Public License v3.0
111 stars 43 forks source link

Read the imgsz parameter in metadata #8

Closed x2031 closed 7 months ago

x2031 commented 7 months ago

Dynamically adjust the imgsz in the prediction process by reading the imgsz parameter in the metadata file.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancements in model input size flexibility and label loading for the YOLO Flutter App.

📊 Key Changes

🎯 Purpose & Impact

These changes aim to make the YOLO Flutter app more versatile and user-friendly, catering to a wider range of models and detection scenarios.

pderrenger commented 7 months ago

Hi there! 👋

Thank you for reaching out! If you're looking to dynamically adjust imgsz based on the metadata, you might consider doing this right before your prediction call. Assuming your metadata is in a readable format like JSON, you could do something like this:

import json

# Assuming 'metadata.json' contains {'imgsz': 640}
with open('metadata.json') as f:
    metadata = json.load(f)

# Update imgsz
imgsz = metadata['imgsz']

# Now, proceed to use imgsz in your prediction settings

This snippet reads the imgsz from a metadata.json file, allowing you to then utilize this size in your prediction workflow. Keep the operation outside critical performance paths to ensure efficiency.

For more info on managing prediction configurations, please visit our documentation at https://docs.ultralytics.com.

Hope that helps! Let the community know if you have further questions. 😊

github-actions[bot] commented 7 months ago

CLA Assistant Lite bot All Contributors have signed the CLA. ✅

x2031 commented 7 months ago

I have read the CLA Document and I sign the CLA