dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.04k stars 1.89k forks source link

Why is there no ResizeImages method? #7210

Open bbhxwl opened 3 months ago

bbhxwl commented 3 months ago

Why is there no ResizeImages method?

image image

luisquintanilla commented 2 months ago

Hi @bbhxwl,

Can you clarify your question? I assume you mean why doesn't Microsoft.ML.OnnxTransformer or OnnxRuntime packages have a ResizeImages transform.

If so, it's a data transformation that's not specific to ONNX. You can find that as part of the Microsoft.ML.ImageAnalytics package.

https://learn.microsoft.com/dotnet/api/microsoft.ml.imageestimatorscatalog.resizeimages?view=ml-dotnet

bbhxwl commented 2 months ago

Hi @bbhxwl,

Can you clarify your question? I assume you mean why doesn't Microsoft.ML.OnnxTransformer or OnnxRuntime packages have a ResizeImages transform.

If so, it's a data transformation that's not specific to ONNX. You can find that as part of the Microsoft.ML.ImageAnalytics package.

https://learn.microsoft.com/dotnet/api/microsoft.ml.imageestimatorscatalog.resizeimages?view=ml-dotnet

Stream stream = new FileStream("e7b1a568c53245928a5146efd401c5e5.jpg", FileMode.Open);
Yolo a = new Yolo("yolov5x.onnx");
var list=a.Prediction(stream);

There seems to be an issue with my post-processing image. Can you guide me?

https://github.com/bbhxwl/AiHelper

luisquintanilla commented 2 months ago

Hi @bbhxwl,

I would encourage you to take a look at this tutorial. It's using an older version of YOLO, but the general concepts are similar.

https://learn.microsoft.com/dotnet/machine-learning/tutorials/object-detection-onnx