public class ImageClassifierResNet extends BaseImageClassifier
1) Look at Torch source code a) Determine the shape of the input tensor. That will be used to set imageSize b) Figure out how it normalizes the input. Are normalization parameters stored in the network? 2) Load model and inspect in a debugger List
list = new ParseBinaryTorch7().parse(new File(path,name));
3) Hopefully no problem loading the target object.
4) Your goal now is to figure out where the network is stored. Inspect the Lua code and the returned object
There is no standard format. For
5) For resnet-18.t7 the first element in the list is the start of the network
TorchGeneric torchSequence = (TorchGeneric)list.get(0);
6) Convert it into a DeepBoof network. Cross your fingers and hope that all the layers are supported.
7) An exception is thrown and it says something isn't support or it just crashes with a weird message
MO**** F***** it's not supported. Contact Peter and hope there's an easy fix or get ready to make a code contribution to DeepBoof
8) You got lucky and no error messages!!!
Nested Class Summary
Constructors Constructor Description
Modifier and Type Method Description
File path)(Loads the model at the specified location.
Methods inherited from class boofcv.deepboof.BaseImageClassifier
classify, getAllResults, getBestResult, getCategories, getImageRgb, getInputType, innerProcess, preprocess
ImageClassifierResNetpublic ImageClassifierResNet(int resnetID)