简体   繁体   English

如何使用 google ml kit 在颤振中进行图像标记?

[英]How to use google ml kit for image labelling in flutter?

how to add the image labelling feature with google ml kit package into the flutter app, there is no examples for that, all examples that shown for me they was using firebase ml kit!如何将带有 google ml kit 包的图像标记功能添加到颤振应用程序中,没有示例,所有示例都向我展示了他们使用的是 firebase ml kit!

So how can we implement this ?那么我们该如何实现呢?

google_ml_kit is pretty new. google_ml_kit 是相当新的。 Take a look at pub.dev example https://pub.dev/packages/google_ml_kit/example看看 pub.dev 示例https://pub.dev/packages/google_ml_kit/example

Google ML Kit Basic (Imp. update): google_ml_kit package has all the functionalities like text recognition, image labelling, barcode scanning, face detection. Google ML Kit Basic (Imp. update): google_ml_kit包具有所有功能,如文本识别、图像标记、条形码扫描、人脸检测。 so app size is getting increased.所以应用程序的大小正在增加。 Recently creator of this packages split it into sub packages specific to the functionality.最近这个包的创建者将其拆分为特定于功能的子包。 Now due to the sub packages app size issue doesn't occurred as we can use the required package instead of using the whole package.现在由于子包应用程序大小问题没有发生,因为我们可以使用所需的包而不是使用整个包。

So for image labelling, you can use google_mlkit_image_labeling package which is split from google_ml_kit package.因此,对于图像标签,您可以使用从google_ml_kit包中拆分出来的 google_mlkit_image_labeling 包。

Code for Image Labelling: For image labelling, you can use below code snippet,图像标签代码:对于图像标签,您可以使用以下代码片段,

XFile image = await ImagePicker().pickImage(ImageSource.Gallery); //Get image using image picker
final InputImage inputImage = InputImage.fromFilePath(image.path); //Get input image object
final ImageLabelerOptions options = ImageLabelerOptions(confidenceThreshold: 0.5);//ImageLabeler option is required to set confident threshold, if we want labels above any confidence, we can set threshold here. confidence is a probability of a label.
final imageLabeler = ImageLabeler(options: options);
final List<ImageLabel> labels = await imageLabeler.processImage(inputImage);

for (ImageLabel label in labels) {
  final String text = label.text; // Image Label
  final double confidence = label.confidence; // Label Confidence, confidence is a probability of label
}

Along with this you need to have some configuration.除此之外,您还需要进行一些配置。 To know more about the required configuration & to understand image labelling code in details with example, refer this link .要了解有关所需配置的更多信息并通过示例详细了解图像标记代码,请参阅此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何将 GOOGLE ML KIT 用于 flutter 应用程序? - How can i use GOOGLE ML KIT for flutter app? 如何使用ML Kit云文本识别器进行扑动? - How to use ML Kit cloud text recognizer for flutter? Flutter Google ML Kit 人脸检测未检测到 - Flutter Google ML Kit Face Detection not detecting 如何使用 Firebase ML Kit 在图像中找到标记? - How to find marks in the image with Firebase ML Kit? 如何在 Flutter 中使用 Google 的 ML Kit Barcode Scanning 实现 Barcode Scanner? - How to implement a Barcode Scanner with Google's ML Kit Barcode Scanning in Flutter? 在 Flutter 中获取面部轮廓后交换面部(Google ML 套件) - Swapping Face After Getting Face Contours In Flutter (Google ML Kit) 在 Flutter 中使用 Google ML-Kit On-Device 文本识别 - Using Google ML-Kit On-Device Text Recognition in Flutter 使用 google_ml_kit flutter 进行锻炼运动计数 - Workout Movement Counting using google_ml_kit flutter Flutter Google-Ml-Kit-plugin - FaceDetector 在 iPhone 相机中不起作用 - Flutter Google-Ml-Kit-plugin - FaceDetector not working in iPhone cameras Flutter - Google ML 套件 - 文本识别 - 无法正确读取机读区 - Flutter - Google ML kit - Text Recognition - Unable to read MRZ correctly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM