Hello, this is C# ML.net object. I have a coding question for ML.net object search
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?