PaddleDetection class

Flutter plugin for PaddlePaddle PP-PicoDet object detection using NCNN.

Constructors

PaddleDetection()

Properties

detectionStream Stream<CameraDetectionEvent>
Stream of detection results from native camera.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

capturePhoto({required String folder, String prefix = 'capture'}) Future<CaptureResult>
Capture current frame. Saves clean + annotated images to folder. Returns paths and detections.
detect(String imagePath) Future<List<DetectionResult>>
Detect objects in an image file.
detectFromBytes(Uint8List data, int width, int height) Future<List<DetectionResult>>
Detect objects from raw RGBA pixel bytes.
dispose() Future<void>
Release native resources.
getAntiSpoof() Future<bool>
Check if anti-spoof is currently enabled.
getGpuCount() Future<int>
Get number of Vulkan GPU devices available.
getNumClass() Future<int>
Get number of classes from loaded model.
hasGpu() Future<bool>
Check if device has Vulkan GPU available for inference.
loadLabelsFromAsset(String fileName) Future<List<String>>
Load label names from a text file in Android assets. File format: one label name per line. Returns the list of labels loaded.
loadLabelsFromFile(String path) Future<List<String>>
Load label names from a text file on device storage. File format: one label name per line. Returns the list of labels loaded.
loadModel({required String paramName, required String binName, int numClass = 2, int sizeId = 0, int cpuGpu = 0}) Future<ModelInfo>
Load model from assets. Returns ModelInfo with actual class count from model.
loadModelFromFile({required String paramPath, required String binPath, int numClass = 2, int sizeId = 0, int cpuGpu = 0}) Future<ModelInfo>
Load model from file paths. Returns ModelInfo with actual class count.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAntiSpoof({required bool enabled}) Future<void>
Enable/disable anti-spoof detection. When enabled, detection is skipped if the image appears to be from a screen/monitor.
setLabels(List<String>? labels) Future<void>
Set custom label names for the loaded model. Pass a list of class names matching the model's class indices. Example: ['person', 'car', 'truck'] for a 3-class model. Pass null or empty list to use built-in labels (COCO for 80-class, generic for others).
setThreshold({required double threshold}) Future<void>
Set detection threshold. Both prob and NMS use the same value.
startCamera() Future<CameraInfo>
Start native camera. Returns texture info.
stopCamera() Future<void>
Stop native camera.
switchCamera() Future<bool>
Switch between front and back camera. Returns true if now using front camera.
toggleFlash({bool? enable}) Future<bool>
Toggle flash. Returns new flash state.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited