Exemplo n.º 1
0
        public InceptionClassifier(AssetManager assetManager)
        {
            _labels.AddRange(ReadLabelsIntoMemory(assetManager, LABEL_FILE));
            _inferenceInterface = new TensorFlowInferenceInterface(assetManager, MODEL_FILE);
            var operation  = _inferenceInterface.GraphOperation(OUTPUT_NAME);
            var numClasses = operation.Output(0).Shape().Size(1);

            //TODO: Confirm in Android, because my results are 1001 labels, 1008 classes
            Console.WriteLine($"Read {_labels.Count} labels, output layer size is {numClasses}");
            var bmp     = BitmapCreate(assetManager, "husky.png");
            var results = Recognize(bmp);
        }
Exemplo n.º 2
0
 long OutputSize()
 {
     return(_inferenceInterface.GraphOperation(OUTPUT_NAME).Output(0).Shape().Size(1));
 }