Fix filename

PiperOrigin-RevId: 225074738
This commit is contained in:
Andrew Selle 2018-12-11 14:48:11 -08:00 committed by TensorFlower Gardener
parent 6ea1bab952
commit 3b94c63e1b
2 changed files with 3 additions and 4 deletions

View File

@ -52,7 +52,7 @@ public class DetectorActivity extends CameraActivity implements OnImageAvailable
private static final int TF_OD_API_INPUT_SIZE = 300; private static final int TF_OD_API_INPUT_SIZE = 300;
private static final boolean TF_OD_API_IS_QUANTIZED = true; private static final boolean TF_OD_API_IS_QUANTIZED = true;
private static final String TF_OD_API_MODEL_FILE = "detect.tflite"; private static final String TF_OD_API_MODEL_FILE = "detect.tflite";
private static final String TF_OD_API_LABELS_FILE = "file:///android_asset/coco_labels_list.txt"; private static final String TF_OD_API_LABELS_FILE = "coco_labels_list.txt";
// Which detection model to use: by default uses Tensorflow Object Detection API frozen // Which detection model to use: by default uses Tensorflow Object Detection API frozen
// checkpoints. // checkpoints.

View File

@ -105,8 +105,7 @@ public class TFLiteObjectDetectionAPIModel implements Classifier {
final TFLiteObjectDetectionAPIModel d = new TFLiteObjectDetectionAPIModel(); final TFLiteObjectDetectionAPIModel d = new TFLiteObjectDetectionAPIModel();
InputStream labelsInput = null; InputStream labelsInput = null;
String actualFilename = labelFilename.split("file:///android_asset/")[1]; labelsInput = assetManager.open(labelFilename);
labelsInput = assetManager.open(actualFilename);
BufferedReader br = null; BufferedReader br = null;
br = new BufferedReader(new InputStreamReader(labelsInput)); br = new BufferedReader(new InputStreamReader(labelsInput));
String line; String line;