dotnet / dotnet/machinelearning
[DNN Image Classification] Add the LoadFromDirectory() as convenient API
- Dominant language
- C#
- Stars
- 9.4k
- Forks
- 2k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 11
Description
We actually have a convenient _custom_ method named LoadFromDirectory() in sample apps which loads the images in a folder with one sub-folder per class (image type) so it is very straight forward for users to create/load the images with their related labels into a DataSet. See sample here:
https://github.com/dotnet/machinelearning-samples/blob/master/samples/csharp/getting-started/DeepLearning_ImageClassification_Training/ImageClassification.Train/Program.cs#L129
This method should work integrated with the upcoming approach that images themselves need also to be loaded as in-memory objects into a DataView, so the pipeline will train with in-memory images and when scoring with the generated model and using a PredictionEngine the user will also be able to classify an in-memory image.
User's feedback:
_"A couple of methods such as LoadFromDirectory are so useful that they may actually be candidates to include in the framework. I actually have a specific use case, with the same approach, where I don't supply meta-data but use the folder structure for labels instead"_
Contributor guide
Assessment
This issue has not been assessed yet.