-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
I have issue when i using onnx model trained with keras and preprocess_input, is ResNet50 model,
if i training without preprocess_input on keras it work on ml.net but when i use preprocess_input will not work, according documentation preprocess_input will process image with caffe style that mean:
The images are converted from RGB to BGR, then each color channel is zero-centered with respect to the ImageNet dataset, without scaling.
this work without preprocess_input
var dataschema = mlContext.Data.LoadFromEnumerable(new List<ImageNetData>());
var transformer =
mlContext.Transforms.ExtractPixels(outputColumnName: "input_1", nameof(ImageNetData.BitImage), interleavePixelColors: true)
.Append(mlContext.Transforms.ApplyOnnxModel(modelFile: path, outputColumnNames: new[] { "fc360" }, inputColumnNames: new[] { "input_1" })) //gpuDeviceId:0
.Fit(dataschema);
i tried this convert from RGB to BGR but i dont see any parameter for zero-centered color mode
mlContext.Transforms.ExtractPixels(outputColumnName: "input_1", nameof(ImageNetData.BitImage), orderOfExtraction: ImagePixelExtractingEstimator.ColorsOrder.ABGR, interleavePixelColors: true)
Maybe i miss something ???