पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv0.0.8

google_ml_vision

Google ML Kit ऑफ़-डिवाइस विज़न API के लिए Flutter प्लगइन। इसमें बारकोड स्कैनिंग, छवि लेबलिंग, पाठ पहचान और चेहरा डिटेक्शन शामिल हैं।

AndroidiOS
30-दिन डाउनलोड
89
लाइक
135
Pub अंक
140

पैकेज इंस्टॉल करें

flutter pub add google_ml_vision

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर प्लगइन जो Google ML Kit के डिवाइस-आधारित दृश्य एपीआई को एकीकृत करता है, जिससे बारकोड स्कैनिंग, छवि लेबलिंग, पाठ पहचान (OCR) और चेहरा पहचान को फ्लटर ऐप्स में सीधे संभव बनाता है। निम्न लेटेंसी के साथ रियल-टाइम प्रोसेसिंग के लिए डिज़ाइन किया गया है, यह एंड्रॉइड और आईओएस डिवाइस पर स्थानीय रूप से चलता है, जिससे गोपनीयता और प्रदर्शन सुनिश्चित होता है। इस प्लगइन के लिए सामान्य कंप्यूटर विजन कार्यों के लिए सरल तरीके हैं, जो बिना क्लाउड सेवाओं पर निर्भर होकर बुद्धिमान छवि विश्लेषण की आवश्यकता वाले मोबाइल ऐप्स के लिए आदर्श हैं।

उपयोग

  • रिटेल ऐप में बारकोड स्कैनिंग
  • चित्रों से पाठ निकालना
  • फोटो ऐप में छवि वर्गीकरण
  • आवधारित वास्तविकता के लिए चेहरा पहचान
  • दस्तावेज़ स्कैनिंग और OCR

मुख्य विशेषताएँ

  • डिवाइस-आधारित प्रोसेसिंग
  • बहुत दृष्टि कार्यों का समर्थन
  • कम लेटेंसी प्रदर्शन
  • Privacy-preserving
  • सरल API एकीकरण

इनके लिए उपयुक्त

  • रियल-टाइम विज़न फीचर्स की आवश्यकता वाले मोबाइल ऐप्स
  • उपयोगकर्ता गोपनीयता को प्राथमिकता देने वाले विकासकर्ता
  • ऑफलाइन कार्यक्षमता की आवश्यकता वाले ऐप्स
  • दस्तावेज़ या AR टूल बना रहे स्टार्टअप
  • मूल एमएल क्षमताओं का उपयोग करने वाले फ्लटर विकासकर्ता

विचार योग्य बातें

  • Android 5.0+ या iOS 10.0+ की आवश्यकता है
  • समर्थित दृष्टि मॉडल तक सीमित
  • बादल-आधारित सुधार नहीं
  • प्रदर्शन उपकरण द्वारा भिन्न होता है
  • iOS के लिए हाथ से कॉन्फ़िगरेशन की आवश्यकता हो सकती है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Google ML Kit Vision Plugin

(https://pub.dev/packages/google_ml_vision)

A Flutter plugin to use the capabilities of on-device Google ML Kit Vision APIs

Usage

To use this plugin, add google_ml_vision as a dependency in your pubspec.yaml file.

Using an ML Vision Detector

1. Create a GoogleVisionImage.

Create a GoogleVisionImage object from your image. To create a GoogleVisionImage from an image File object:

final File imageFile = getImageFile();
final GoogleVisionImage visionImage = GoogleVisionImage.fromFile(imageFile);
2. Create an instance of a detector.
final BarcodeDetector barcodeDetector = GoogleVision.instance.barcodeDetector();
final FaceDetector faceDetector = GoogleVision.instance.faceDetector();
final ImageLabeler labeler = GoogleVision.instance.imageLabeler();
final TextRecognizer textRecognizer = GoogleVision.instance.textRecognizer();

You can also configure all detectors, except TextRecognizer, with desired options.

final ImageLabeler labeler = GoogleVision.instance.imageLabeler(
  ImageLabelerOptions(confidenceThreshold: 0.75),
);
3. Call detectInImage() or processImage() with visionImage.
final List<Barcode> barcodes = await barcodeDetector.detectInImage(visionImage);
final List<Face> faces = await faceDetector.processImage(visionImage);
final List<ImageLabel> labels = await labeler.processImage(visionImage);
final VisionText visionText = await textRecognizer.processImage(visionImage);
4. Extract data.

a. Extract barcodes.

for (Barcode barcode in barcodes) {
  final Rectangle<int> boundingBox = barcode.boundingBox;
  final List<Point<int>> cornerPoints = barcode.cornerPoints;

  final String rawValue = barcode.rawValue;

  final BarcodeValueType valueType = barcode.valueType;

  // See API reference for complete list of supported types
  switch (valueType) {
    case BarcodeValueType.wifi:
      final String ssid = barcode.wifi.ssid;
      final String password = barcode.wifi.password;
      final BarcodeWiFiEncryptionType type = barcode.wifi.encryptionType;
      break;
    case BarcodeValueType.url:
      final String title = barcode.url.title;
      final String url = barcode.url.url;
      break;
  }
}

b. Extract faces.

for (Face face in faces) {
  final Rectangle<int> boundingBox = face.boundingBox;

  final double rotY = face.headEulerAngleY; // Head is rotated to the right rotY degrees
  final double rotZ = face.headEulerAngleZ; // Head is tilted sideways rotZ degrees

  // If landmark detection was enabled with FaceDetectorOptions (mouth, ears,
  // eyes, cheeks, and nose available):
  final FaceLandmark leftEar = face.getLandmark(FaceLandmarkType.leftEar);
  if (leftEar != null) {
    final Point<double> leftEarPos = leftEar.position;
  }

  // If classification was enabled with FaceDetectorOptions:
  if (face.smilingProbability != null) {
    final double smileProb = face.smilingProbability;
  }

  // If face tracking was enabled with FaceDetectorOptions:
  if (face.trackingId != null) {
    final int id = face.trackingId;
  }
}

c. Extract labels.

for (ImageLabel label in labels) {
  final String text = label.text;
  final String entityId = label.entityId;
  final double confidence = label.confidence;
}

d. Extract text.

String text = visionText.text;
for (TextBlock block in visionText.blocks) {
  final Rect boundingBox = block.boundingBox;
  final List<Offset> cornerPoints = block.cornerPoints;
  final String text = block.text;
  final List<RecognizedLanguage> languages = block.recognizedLanguages;

  for (TextLine line in block.lines) {
    // Same getters as TextBlock
    for (TextElement element in line.elements) {
      // Same getters as TextBlock
    }
  }
}
5. Release resources with close().
barcodeDetector.close();
faceDetector.close();
labeler.close();
textRecognizer.close();

Getting Started

See the example directory for a complete sample app using Google Machine Learning.

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।