machinelearning-samples icon indicating copy to clipboard operation
machinelearning-samples copied to clipboard

Hello, this is C# ML.net object. I have a coding question for ML.net object search

Open codingyoutub opened this issue 4 years ago • 0 comments

https://docs.microsoft.com/ko-kr/dotnet/machine-learning/tutorials/image-classification

I’m studying at the top.

` public class ImageNetData { [LoadColumn(0)] public string ImagePath;

[LoadColumn(1)]
public string Label;

public static IEnumerable<ImageNetData> ReadFromFile(string imageFolder)
{
    return Directory
        .GetFiles(imageFolder)
        .Where(filePath => Path.GetExtension(filePath) != ".md")
        .Select(filePath => new ImageNetData { ImagePath = filePath, Label = Path.GetFileName(filePath) });
}

} `

` IEnumerable<ImageNetData> images = ImageNetData.ReadFromFile(imagesFolder); IDataView imageDataView = mlContext.Data.LoadFromEnumerable(images); var modelScorer = new OnnxModelScorer(imagesFolder, modelFilePath, mlContext);

// Use model to score data IEnumerable<float[]> probabilities = modelScorer.Score(imageDataView); `

I think the syntax code here is a way to get it into a folder and save the image file inside, but I want to send the image of the picturebox to get the result value.

But this is a way to take all the pictures in the folder and save them as outford…

How can I send the image of the picturebox to produce the results?

codingyoutub avatar Apr 11 '21 13:04 codingyoutub