detectFromBytes method

  1. @override
Future<List<DetectionResult>> detectFromBytes({
  1. required Uint8List data,
  2. required int width,
  3. required int height,
})
override

Run detection on raw RGBA pixel bytes (e.g., from camera frame).

Implementation

@override
Future<List<DetectionResult>> detectFromBytes({
  required Uint8List data,
  required int width,
  required int height,
}) async {
  final result = await methodChannel.invokeMethod<List<dynamic>>('detectFromBytes', {
    'data': data,
    'width': width,
    'height': height,
  });
  if (result == null) return [];
  return result.map((e) => DetectionResult.fromMap(e as Map<dynamic, dynamic>)).toList();
}