public class TensorFlowImageClassifier extends java.lang.Object implements Classifier
Classifier.Recognition
Modifier and Type | Method and Description |
---|---|
void |
close() |
static Classifier |
create(android.content.res.AssetManager assetManager,
java.lang.String modelFilename,
java.lang.String labelFilename,
int inputSize,
int imageMean,
float imageStd,
java.lang.String inputName,
java.lang.String outputName)
Initializes a native TensorFlow session for classifying images.
|
void |
enableStatLogging(boolean logStats) |
java.lang.String |
getStatString() |
java.util.List<Classifier.Recognition> |
recognizeImage(android.graphics.Bitmap bitmap) |
public static Classifier create(android.content.res.AssetManager assetManager, java.lang.String modelFilename, java.lang.String labelFilename, int inputSize, int imageMean, float imageStd, java.lang.String inputName, java.lang.String outputName)
assetManager
- The asset manager to be used to load assets.modelFilename
- The filepath of the model GraphDef protocol buffer.labelFilename
- The filepath of label file for classes.inputSize
- The input size. A square image of inputSize x inputSize is assumed.imageMean
- The assumed mean of the image values.imageStd
- The assumed std of the image values.inputName
- The label of the image input node.outputName
- The label of the output node.java.io.IOException
public java.util.List<Classifier.Recognition> recognizeImage(android.graphics.Bitmap bitmap)
recognizeImage
in interface Classifier
public void enableStatLogging(boolean logStats)
enableStatLogging
in interface Classifier
public java.lang.String getStatString()
getStatString
in interface Classifier
public void close()
close
in interface Classifier
Copyright © 2012 PayPal, Inc. All Rights Reserved.