Class BatchInputParser
- java.lang.Object
-
- ai.konduit.serving.input.conversion.BatchInputParser
-
public class BatchInputParser extends java.lang.ObjectParses a whole multi part upload buffer and converts it to anINDArrayminibatch.Uses
InputAdapterspecified by name allowing conversion of each type of input file's raw content to anINDArray- Author:
- Adam Gibson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBatchInputParser.BatchPartInfo
-
Constructor Summary
Constructors Constructor Description BatchInputParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectconvert(io.vertx.core.buffer.Buffer input, java.lang.String name, ConverterArgs params, io.vertx.ext.web.RoutingContext routingContext)Use the converter specified by name to convert a rawBufferto a proper input for inferenceorg.datavec.api.records.Record[]createBatch(io.vertx.ext.web.RoutingContext routingContext)Create a batch from theRoutingContext
-
-
-
Method Detail
-
createBatch
public org.datavec.api.records.Record[] createBatch(io.vertx.ext.web.RoutingContext routingContext) throws java.io.IOExceptionCreate a batch from theRoutingContext- Parameters:
routingContext- the routing context to create the batch from- Returns:
- the proper ndarray batch with the ndarrays merged with a batch per input
- Throws:
java.io.IOException- I/O Exception
-
convert
public java.lang.Object convert(io.vertx.core.buffer.Buffer input, java.lang.String name, ConverterArgs params, io.vertx.ext.web.RoutingContext routingContext) throws java.io.IOExceptionUse the converter specified by name to convert a rawBufferto a proper input for inference- Parameters:
input- the raw contentname- the name of the input converter to useparams- the params to use where neededroutingContext- RoutingContext- Returns:
- converted INDArray
- Throws:
java.io.IOException- I/O Exception
-
-