I have this code:
Dim pipeline = ImageEstimatorsCatalog.LoadImages(mlContext.Transforms,
imagesFolder, ("ImagePath", "ImageReal")).
Append(ImageEstimatorsCatalog.Resize(mlContext.Transforms, "ImageReal", "ImageReal", ImageNetSettings.imageHeight, ImageNetSettings.imageWidth, resizing:=ImageResizerTransform.ResizingKind.IsoPad)).
Append(ImageEstimatorsCatalog.ExtractPixels(mlContext.Transforms, {New ImagePixelExtractorTransform.ColumnInfo("ImageReal", "image_tensor",
colors:=ImagePixelExtractorTransform.ColorBits.Rgb, interleave:=ImageNetSettings.channelsLast,
offset:=ImageNetSettings.mean, scale:=ImageNetSettings.scale)})).
Append(New TensorFlowEstimator(mlContext, modelLocation, {"image_tensor"}, {"detection_scores", "detection_boxes", "detection_classes", "num_detections"}))
Dim modeld = pipeline.Fit(data)
When I compile it I get the following error:
Schema mismatch for input column 'image_tensor': expected U1, got R4
Parameter name: inputSchema
Because the input node of the model I am using is Uinteger and the default vector Image generated by ImageEstimatorsCatalog.ExtractPixels is a float.
I tried to do the conversion using:
Append(ConversionsExtensionsCatalog.ConvertType(mlContext.Transforms.Conversion,
"image_tensor", "image_tensor", DataKind.U1))
But it does not work.
Any ideas on how to convert from float to Uinteger in the pipeline?
Thanks