Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CustomVisionOnnx won't work properly after upgrading to ML. NET 2.0 #28

Open
BigHeadDev opened this issue Mar 17, 2023 · 1 comment
Open

Comments

@BigHeadDev
Copy link

I can confirm that the problem is with the nuget package Microsoft.ML.ImageAnalytics
Due to some changes in its dependency during the process from 1. x to 2.0, it no longer relies on System.Drawing.Common
image
image

The following code snippet shows the key errors:

public class WineInput {// C# Input Mapping
        [ImageType(ImageSettings.imageWidth, ImageSettings.imageHeight)]
        public Bitmap Image { get; set; }
    }
    public struct ImageSettings {
        public const int imageHeight = 416;
        public const int imageWidth = 416;
    }
MLContext context = new MLContext();
            var emptyData = new List<WineInput>();
            var data = context.Data.LoadFromEnumerable(emptyData);// Error!

How should I modify the code to use Microsoft.ML.ImageAnalytics 2.0

Thank you very much for the video posted on Youtube and learning a lot~I hope you can help me solve this problem
😁

@jwood803
Copy link
Owner

Sorry for the late reply. I think 2.0 removed some image packages in favor of some that are more cross platform. I do have a plan to make a video that updates the Custom Vision Object Detection scenario where you build an object detection model in Custom Vision and use it in ML.NET. Hope that will help!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants