Skip to content

Making a prediction from ONNX model in ML.net #3562

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

Closed
Varusnguyen opened this issue Apr 24, 2019 · 8 comments · Fixed by #3851
Closed

Making a prediction from ONNX model in ML.net #3562

Varusnguyen opened this issue Apr 24, 2019 · 8 comments · Fixed by #3851
Assignees
Labels
enhancement New feature or request P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away.

Comments

@Varusnguyen
Copy link

Varusnguyen commented Apr 24, 2019

System information

  • **OS version: window 10
  • Ml.Net verison: 0.11

Issue

Hi, everyone. I am a newbie of using ML.net to implement my classification problem. I already trained a model from CIFA 10 datasets based on Keras library and that model has been transferred to ONNX model. My goal is to display the image's prediction task on WindowForm, so I am going to use ML.net integrated with ONNX model, but right now I am getting stuck on how to use the ONNX model on ML.net and how to define the label and get the prediction result by the model. Do you have any suggestion to me? Thank you a lot in advance.

Source code / logs

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

@PeterPann23
Copy link

Hi Varusnguyen

Nice to see you, have a look at the onnox sample

Also the tests in the project are a good start.

@usmankaiiz
Copy link

Can someone guide me, how to pass video frames instead of pictures which are stored in folders? in the pipeline?

var pipeline = mlContext.Transforms.LoadImages(outputColumnName: "image", imageFolder: imagesFolder,

@PeterPann23
Copy link

Hi, Not sure, never did that, however, how will you correctly label them so the model learns...
When I Look on the www I get this method to capture frames from a video. might not work for you but if it helps you than glad to help.

@yaeldekel
Copy link

Hi @Varusnguyen, thank you for trying out ML.NET.
Issue #3460 discusses how to pass Bitmaps instead of pictures stored in folders, you may find it useful.

@Varusnguyen
Copy link
Author

Thanks for many useful suggestions, it helped me a lot to gain knowledge about ONNX and ML.net. Btw, I also found out a helpful material of using C# to display the result from ONNX model, you can read to get more details.
https://github.com/microsoft/onnxruntime

@wschin wschin added enhancement New feature or request P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away. labels May 21, 2019
@wschin wschin self-assigned this May 21, 2019
@CESARDELATORRE
Copy link
Contributor

@usmankaiiz - This might interest you. Since ML.NET 1.1 we can also very easily load in-memory images into the pipeline targeting an ONNX or TensorFlow models, for instance.

For ONNX, this example is using in-memory images instead of images coming from files on the hard drive:

https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/end-to-end-apps/DeepLearning_ObjectDetection_Onnx

@nfnpmc
Copy link

nfnpmc commented Aug 21, 2019

Link is dead!

@CESARDELATORRE
Copy link
Contributor

CESARDELATORRE commented Aug 21, 2019

It was moved here:
https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/end-to-end-apps/ObjectDetection-Onnx

An btw, in that same solution we added a WPF app sample which is streaming video while using object detection. :)

@ghost ghost locked as resolved and limited conversation to collaborators Mar 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants