Skip to content

Fixing API call in LoadImages sample #3084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void Example()

var imagesFolder = Path.GetDirectoryName(imagesDataFile);
// Image loading pipeline.
var pipeline = mlContext.Transforms.LoadImages(imagesFolder, "ImageObject", "ImagePath")
var pipeline = mlContext.Transforms.LoadImages("ImageObject", imagesFolder, "ImagePath")
.Append(mlContext.Transforms.ConvertToGrayscale("Grayscale", "ImageObject"));

var transformedData = pipeline.Fit(data).Transform(data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.IO;
using System.Linq;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Onnx;

namespace Microsoft.ML.Samples.Dynamic
{
Expand Down Expand Up @@ -40,7 +39,7 @@ public static void Example()
// Installing the Microsoft.ML.DNNImageFeaturizer packages copies the models in the
// `DnnImageModels` folder.
// Image loading pipeline.
var pipeline = mlContext.Transforms.LoadImages(imagesFolder, "ImageObject", "ImagePath")
var pipeline = mlContext.Transforms.LoadImages("ImageObject", imagesFolder, "ImagePath")
.Append(mlContext.Transforms.ResizeImages("ImageObject", imageWidth: 224, imageHeight: 224))
.Append(mlContext.Transforms.ExtractPixels("Pixels", "ImageObject"))
.Append(mlContext.Transforms.DnnFeaturizeImage("FeaturizedImage", m => m.ModelSelector.ResNet18(mlContext, m.OutputColumn, m.InputColumn), "Pixels"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void Example()

var imagesFolder = Path.GetDirectoryName(imagesDataFile);
// Image loading pipeline.
var pipeline = mlContext.Transforms.LoadImages(imagesFolder, "ImageObject", "ImagePath")
var pipeline = mlContext.Transforms.LoadImages("ImageObject", imagesFolder, "ImagePath")
.Append(mlContext.Transforms.ResizeImages("ImageObject", imageWidth: 100, imageHeight: 100 ))
.Append(mlContext.Transforms.ExtractPixels("Pixels", "ImageObject"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void Example()

var imagesFolder = Path.GetDirectoryName(imagesDataFile);
// Image loading pipeline.
var pipeline = mlContext.Transforms.LoadImages(imagesFolder, "ImageReal", "ImagePath");
var pipeline = mlContext.Transforms.LoadImages("ImageReal", imagesFolder, "ImagePath");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoadImages [](start = 48, length = 10)

Hi @rogancarr, thanks for addressing this issue.
Sorry, I should have been more specific in the issue itself - there are a few more references to this API in the samples project (DnnFeaturizeImage, ResizeImage, ConvertToGrayScale, ExtractPixels), could you update these as well?

var transformedData = pipeline.Fit(data).Transform(data);

// The transformedData IDataView contains the loaded images now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void Example()

var imagesFolder = Path.GetDirectoryName(imagesDataFile);
// Image loading pipeline.
var pipeline = mlContext.Transforms.LoadImages(imagesFolder, "ImageReal", "ImagePath")
var pipeline = mlContext.Transforms.LoadImages("ImageReal", imagesFolder, "ImagePath")
.Append(mlContext.Transforms.ResizeImages("ImageReal", imageWidth: 100, imageHeight: 100));


Expand Down