The new DNN-Transfer-Learning is very nicely simplified (and it'll be even more simplified), however, the way it is now doesn't support to train and score with in-memory images, therefore, if you train with image filepaths, the model for scoring also requires image paths...
That's limiting in-memory images scenarios that we really need to support.
For instance, in the code below, the API ImageClassification() is expecting image filepaths, only.
public class ImageData
{
[LoadColumn(0)]
public string ImagePath;
[LoadColumn(1)]
public string Label;
}
//...
var pipeline = mlContext.Transforms.Conversion.MapValueToKey(outputColumnName: "LabelAsKey",
inputColumnName: "Label",
keyOrdinality: ValueToKeyMappingEstimator.KeyOrdinality.ByValue)
.Append(mlContext.Model.ImageClassification("ImagePath", "LabelAsKey",
arch: ImageClassificationEstimator.Architecture.ResnetV2101,
epoch: 100, //An epoch is one learning cycle where the learner sees the whole training data set.
batchSize: 100, // batchSize sets the number of images to feed the model at a time. It needs to divide the training set evenly or the remaining part won't be used for training. Use 10 for hundreds of images, 100 for thousands of images
metricsCallback: (metrics) => Console.WriteLine(metrics),
reuseTrainSetBottleneckCachedValues: false,
reuseValidationSetBottleneckCachedValues: false,
validationSet: transformedValidationDataView));
The new DNN-Transfer-Learning is very nicely simplified (and it'll be even more simplified), however, the way it is now doesn't support to train and score with in-memory images, therefore, if you train with image filepaths, the model for scoring also requires image paths...
That's limiting in-memory images scenarios that we really need to support.
For instance, in the code below, the API ImageClassification() is expecting image filepaths, only.