identity_document_detection 0.0.1
SDKflutter
Platformandroidios
Use tensor flow lite for detect identity documents on mobile devices
Identity Document Detection
Use tensor flow lite for detect identity documents on mobile devices
Platform Support
NOTE: The package maybe add support on future.
| Android | iOS | macOS | Windows | Linux | |
|---|---|---|---|---|---|
| Support | ✔ | ✔ | ✖ | ✖ | ✖ |
Features
Use this plugin in your Flutter app to:
- Not required network connection.
- Run on single image and real time.
- Detect type of a card.
- Detect side of document.
- Detect position on image.
on future must detect brightness and sharpness
Getting started
-
Add
identity_document_detectionto yourpubspec.yaml:dependencies: identity_document_detection: latest_version -
Run
flutter pub getto install.
Usage
You have 2 ways to use it:
- Using the
IdentityDetectorwidget
class DetectorPage extends StatelessWidget {
const DetectorPage({super.key});
@override
Widget build(BuildContext context) {
return Center(
child: IdentityDetector(
options: IDOptions(
confidence: 0.85,
detection: IDTypeDetection.multiple,
onDocumentDetect: (recognitions) {
// TODO: Add your own logic here
},
),
),
);
}
}
- Creating
IDControllerand initializing it
final detector = await IDController.initialize(widget.options);
_detector = detector;
_subscription = detector.stream.listen((values) {
final painter = ObjectDetectorPainter(values);
_customPaint = CustomPaint(painter: painter);
setState(() {});
});
Callback to receive each frame CameraImage perform inference on it
void onImageAvailable(CameraImage cameraImage) async {
_detector?.processFrame(cameraImage);
}
And for dispose you should use
_detector?.stop();
[!IMPORTANT] For now the package adds a high weight to the project, it must be taken into consideration when taking it to stores, this will improve in the future.
Coming soon
- Detect brightness on image.
- Detect sharpness on document.