internal DnnImageFeaturizerInput(string outputColumnName, string inputColumnName, IHostEnvironment env, DnnImageModelSelector modelSelector) { Environment = env; InputColumn = inputColumnName; OutputColumn = outputColumnName; ModelSelector = modelSelector; }
public DnnImageFeaturizerInput(IHostEnvironment env, string inputColumn, string outputColumn, DnnImageModelSelector modelSelector) { Environment = env; InputColumn = inputColumn; OutputColumn = outputColumn; ModelSelector = modelSelector; }
/// <summary> /// This allows a custom model location to be specified. This is useful is a custom model is specified, /// or if the model is desired to be placed or shipped separately in a different folder from the main application. Note that because Onnx models /// must be in a directory all by themsleves for the OnnxTransformer to work, this method appends a AlexNetOnnx/AlexNetPrepOnnx subdirectory /// to the passed in directory to prevent having to make that directory manually each time. /// </summary> public static EstimatorChain <ColumnCopyingTransformer> AlexNet(this DnnImageModelSelector dnnModelContext, IHostEnvironment env, string outputColumnName, string inputColumnName, string modelDir) { var modelChain = new EstimatorChain <ColumnCopyingTransformer>(); var inputRename = new ColumnCopyingEstimator(env, new[] { ("OriginalInput", inputColumnName) });
/// <summary> /// Returns an estimator chain with the two corresponding models (a preprocessing one and a main one) required for the AlexNet pipeline. /// Also includes the renaming ColumnsCopyingTransforms required to be able to use arbitrary input and output column names. /// This assumes both of the models are in the same location as the file containing this method, which they will be if used through the NuGet. /// This should be the default way to use AlexNet if importing the model from a NuGet. /// </summary> public static EstimatorChain <ColumnCopyingTransformer> AlexNet(this DnnImageModelSelector dnnModelContext, IHostEnvironment env, string outputColumnName, string inputColumnName) { return(AlexNet(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AssemblyPathHelpers.GetExecutingAssemblyLocation(), "DnnImageModels"))); }
/// <summary> /// Returns an estimator chain with the two corresponding models (a preprocessing one and a main one) required for the AlexNet pipeline. /// Also includes the renaming ColumnsCopyingTransforms required to be able to use arbitrary input and output column names. /// This assumes both of the models are in the same location as the file containing this method, which they will be if used through the NuGet. /// This should be the default way to use AlexNet if importing the model from a NuGet. /// </summary> public static EstimatorChain <ColumnCopyingTransformer> AlexNet(this DnnImageModelSelector dnnModelContext, IHostEnvironment env, string inputColumn, string outputColumn) { return(AlexNet(dnnModelContext, env, inputColumn, outputColumn, Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "DnnImageModels"))); }
/// <summary> /// Returns an estimator chain with the two corresponding models (a preprocessing one and a main one) required for the ResNet pipeline. /// Also includes the renaming ColumnsCopyingTransforms required to be able to use arbitrary input and output column names. /// This assumes both of the models are in the same location as the file containing this method, which they will be if used through the NuGet. /// This should be the default way to use ResNet101 if importing the model from a NuGet. /// </summary> public static EstimatorChain <ColumnCopyingTransformer> ResNet101(this DnnImageModelSelector dnnModelContext, IHostEnvironment env, string outputColumnName, string inputColumnName) { return(ResNet101(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"))); }