detectBatch method

Future<List<NsfwResult?>> detectBatch(
  1. List<Uint8List> images
)

Detects NSFW content from a batch of image bytes sequentially.

Implementation

Future<List<NsfwResult?>> detectBatch(List<Uint8List> images) async {
  if (_isClosed) throw StateError('NsfwDetector has been closed.');

  final results = <NsfwResult?>[];
  for (final imageData in images) {
    results.add(await detectNSFWFromBytes(imageData));
  }
  return results;
}