1

I have a piece of code and unable to get this, but only understood part of image picker. Anybody explain me, what is the roll of FirebaseVisionImage. By the way i'm using firebase_ml_vision

Future pickImage() async {
    var awaitImage = await ImagePicker.pickImage(source: ImageSource.gallery);

    setState(() {
      pickedImage = awaitImage;
      imageLoaded = true;
    });

    FirebaseVisionImage visionImage = FirebaseVisionImage.fromFile(pickedImage);

    final ImageLabeler cloudLabeler = FirebaseVision.instance.cloudImageLabeler();

    final List<ImageLabel> cloudLabels =
        await cloudLabeler.processImage(visionImage);

    for (ImageLabel label in cloudLabels) {
      final double confidence = label.confidence;
      setState(() {

        text = "$text $label.text   $confidence.toStringAsFixed(2) \n";

        print(text);
      });
    }

    cloudLabeler.close();
  }
Ben Weiss
  • 17,182
  • 6
  • 67
  • 87
Shruti Ramnandan Sharma
  • 4,027
  • 13
  • 44
  • 76
  • If you mean that you can't understand what FirebaseVisionImage class does - then you can always check the API of the package [https://pub.dev/documentation/firebase_ml_vision/latest/firebase_ml_vision/FirebaseVisionImage-class.html](https://pub.dev/documentation/firebase_ml_vision/latest/firebase_ml_vision/FirebaseVisionImage-class.html). FirebaseVisionImage class - Represents an image object used for both on-device and cloud API detectors. – Thepeanut May 25 '20 at 05:48
  • I checked but still not understand , cloud API detectors? – Shruti Ramnandan Sharma May 25 '20 at 08:21
  • The flutter plugin is not up-to-date for ML Kit, do you want to use native Android instead of Flutter? Also, we would like to hear how much do you want to have Flutter in your project, and we could discuss internally. – Shiyu Jun 08 '20 at 23:15

0 Answers0