use of boofcv.core.image.border.BorderType in project BoofCV by lessthanoptimal.
the class ImageClassifierVggCifar10 method loadModel.
/**
* Expects there to be two files in the provided directory:<br>
* YuvStatistics.txt<br>
* model.net<br>
*
* @param directory Directory containing model files
* @throws IOException Throw if anything goes wrong while reading data
*/
@Override
public void loadModel(File directory) throws IOException {
stats = DeepModelIO.load(new File(directory, "YuvStatistics.txt"));
SequenceAndParameters<Tensor_F32, Function<Tensor_F32>> sequence = new ParseBinaryTorch7().parseIntoBoof(new File(directory, "model.net"));
network = sequence.createForward(3, inputSize, inputSize);
tensorOutput = new Tensor_F32(WI(1, network.getOutputShape()));
BorderType type = BorderType.valueOf(stats.border);
localNorm = new ImageLocalNormalization<>(GrayF32.class, type);
kernel = DataManipulationOps.create1D_F32(stats.kernel);
}
Aggregations