Rename Tensorflow Android example java classes to TensorFlow to fix native
method binding error. Change: 127585524
This commit is contained in:
parent
19181afb32
commit
194efde518
@ -424,7 +424,7 @@ public class CameraConnectionFragment extends Fragment {
|
||||
backgroundThread = new HandlerThread("ImageListener");
|
||||
backgroundThread.start();
|
||||
backgroundHandler = new Handler(backgroundThread.getLooper());
|
||||
|
||||
|
||||
inferenceThread = new HandlerThread("InferenceThread");
|
||||
inferenceThread.start();
|
||||
inferenceHandler = new Handler(inferenceThread.getLooper());
|
||||
@ -440,7 +440,7 @@ public class CameraConnectionFragment extends Fragment {
|
||||
backgroundThread.join();
|
||||
backgroundThread = null;
|
||||
backgroundHandler = null;
|
||||
|
||||
|
||||
inferenceThread.join();
|
||||
inferenceThread = null;
|
||||
inferenceThread = null;
|
||||
@ -449,7 +449,7 @@ public class CameraConnectionFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
private final TensorflowImageListener tfPreviewListener = new TensorflowImageListener();
|
||||
private final TensorFlowImageListener tfPreviewListener = new TensorFlowImageListener();
|
||||
|
||||
private final CameraCaptureSession.CaptureCallback captureCallback =
|
||||
new CameraCaptureSession.CaptureCallback() {
|
||||
@ -539,7 +539,7 @@ public class CameraConnectionFragment extends Fragment {
|
||||
LOGGER.i("Getting assets.");
|
||||
tfPreviewListener.initialize(
|
||||
getActivity().getAssets(), scoreView, inferenceHandler, sensorOrientation);
|
||||
LOGGER.i("Tensorflow initialized.");
|
||||
LOGGER.i("TensorFlow initialized.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,11 +27,11 @@ import java.util.StringTokenizer;
|
||||
/**
|
||||
* JNI wrapper class for the Tensorflow native code.
|
||||
*/
|
||||
public class TensorflowClassifier implements Classifier {
|
||||
public class TensorFlowClassifier implements Classifier {
|
||||
private static final String TAG = "TensorflowClassifier";
|
||||
|
||||
// jni native methods.
|
||||
public native int initializeTensorflow(
|
||||
public native int initializeTensorFlow(
|
||||
AssetManager assetManager,
|
||||
String model,
|
||||
String labels,
|
@ -37,7 +37,7 @@ import java.util.List;
|
||||
/**
|
||||
* Class that takes in preview frames and converts the image to Bitmaps to process with Tensorflow.
|
||||
*/
|
||||
public class TensorflowImageListener implements OnImageAvailableListener {
|
||||
public class TensorFlowImageListener implements OnImageAvailableListener {
|
||||
private static final Logger LOGGER = new Logger();
|
||||
|
||||
private static final boolean SAVE_PREVIEW_BITMAP = false;
|
||||
@ -61,7 +61,7 @@ public class TensorflowImageListener implements OnImageAvailableListener {
|
||||
|
||||
private Integer sensorOrientation;
|
||||
|
||||
private final TensorflowClassifier tensorflow = new TensorflowClassifier();
|
||||
private final TensorFlowClassifier tensorflow = new TensorFlowClassifier();
|
||||
|
||||
private int previewWidth = 0;
|
||||
private int previewHeight = 0;
|
||||
@ -69,10 +69,10 @@ public class TensorflowImageListener implements OnImageAvailableListener {
|
||||
private int[] rgbBytes = null;
|
||||
private Bitmap rgbFrameBitmap = null;
|
||||
private Bitmap croppedBitmap = null;
|
||||
|
||||
|
||||
private boolean computing = false;
|
||||
private Handler handler;
|
||||
|
||||
|
||||
private RecognitionScoreView scoreView;
|
||||
|
||||
public void initialize(
|
||||
@ -81,7 +81,7 @@ public class TensorflowImageListener implements OnImageAvailableListener {
|
||||
final Handler handler,
|
||||
final Integer sensorOrientation) {
|
||||
Assert.assertNotNull(sensorOrientation);
|
||||
tensorflow.initializeTensorflow(
|
||||
tensorflow.initializeTensorFlow(
|
||||
assetManager, MODEL_FILE, LABEL_FILE, NUM_CLASSES, INPUT_SIZE, IMAGE_MEAN, IMAGE_STD,
|
||||
INPUT_NAME, OUTPUT_NAME);
|
||||
this.scoreView = scoreView;
|
||||
@ -123,7 +123,7 @@ public class TensorflowImageListener implements OnImageAvailableListener {
|
||||
if (image == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// No mutex needed as this method is not reentrant.
|
||||
if (computing) {
|
||||
image.close();
|
Loading…
Reference in New Issue
Block a user