我将模型训练为:https : //www.google.com.au/amp/s/blog.roboflow.com/training-a-tensorflow-object-detection-model-with-a-custom-dataset/amp/ 并将其转换为 tflite。然后我尝试将AI模型放在一个android APP中。我遵循:https : //developers.google.com/ml-kit/vision/object-detection/custom-models/android? fbclid = IwAR07uNgzQ2c5PTp13TiPVeKGQsXaJnJR9jzyvtviXCRegFFJlM-_G799TlY 将位图转换为 InputImage 对象。并进行所有配置。我转换了图像,然后加载模型尝试打印结果:
// getting bitmap of the image
Bitmap photo = (Bitmap) data.getExtras().get("data");
//convert image
InputImage image = InputImage.fromBitmap(photo,0);
//load local model
LocalModel localModel =
new LocalModel.Builder()
.setAssetFilePath("mobilenet_v1_1.0_224_quant.tflite")
// or .setAbsoluteFilePath(absolute file path to tflite model)
.build();
// Multiple object detection in static images
CustomObjectDetectorOptions customObjectDetectorOptions =
new CustomObjectDetectorOptions.Builder(localModel)
.setDetectorMode(CustomObjectDetectorOptions.SINGLE_IMAGE_MODE)
.enableMultipleObjects()
.enableClassification()
.setClassificationConfidenceThreshold(0.5f)
.setMaxPerObjectLabelCount(3)
.build();
ObjectDetector objectDetector =
ObjectDetection.getClient(customObjectDetectorOptions);
objectDetector
.process(image)
.addOnFailureListener(e -> {System.out.println(e.getMessage());})
.addOnSuccessListener(results -> …Run Code Online (Sandbox Code Playgroud) command当我使用+ shift+ P 然后使用“jupyter:创建一个新项目”时效果很好。
对于这个文件,我使用了该函数。有一天,我关闭 VS Code,再次打开时发现“ipynb”看起来像“json”。
我怎样才能让它回到jupyter笔记本?