Fix filename
PiperOrigin-RevId: 225074738
This commit is contained in:
parent
6ea1bab952
commit
3b94c63e1b
@ -52,8 +52,8 @@ 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.
|
||||||
private enum DetectorMode {
|
private enum DetectorMode {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user