Search…
Pipeline Steps
Various type of steps is available in the Pipeline of Konduit-Serving.
Konduit-Serving provides various types of steps included in Pipeline from pre-processing, serving Machine Learning or Deep Learning model and post-processing. This section offers all the configurations with descriptions that may help set your Pipeline Steps. The example of PipelineSteps:
1
inferenceConfiguration.pipeline(SequencePipeline.builder()
2
.add(new ImageToNDArrayStep() //add ImageToNDArrayStep() into pipeline to set image to NDArray for input
3
.config(new ImageToNDArrayConfig() //image configuration
4
.width(28)
5
.height(28)
6
.dataType(NDArrayType.FLOAT)
7
.aspectRatioHandling(AspectRatioHandling.CENTER_CROP)
8
.includeMinibatchDim(true)
9
.channelLayout(NDChannelLayout.GRAYSCALE)
10
.format(NDFormat.CHANNELS_FIRST)
11
.normalization(ImageNormalization.builder().type(ImageNormalization.Type.SCALE).build())
12
)
13
.keys("image")
14
.outputNames("input_layer")
15
.keepOtherValues(true)
16
.metadata(false)
17
.metadataKey(ImageToNDArrayStep.DEFAULT_METADATA_KEY))
18
.add(new Nd4jTensorFlowStep() //add Nd4jTensorFlowStep into pipeline
19
.modelUri(modelTrainResult.modelPath())
20
.inputNames(modelTrainResult.inputNames())
21
.outputNames(modelTrainResult.outputNames())
22
).add(new ClassifierOutputStep()
23
.inputName(modelTrainResult.outputNames().get(0))
24
.labels(Arrays.asList(labels.clone()))
25
.allProbabilities(false)
26
).build()
27
);
Copied!
Here are the references in this section:
Copy link