processFile method

  1. @override
Future<SegmentationResult> processFile(
  1. String filePath,
  2. Uint8List frameData,
  3. SegmenterInputMetadata metadata
)
override

Process an image file and return segmentation result.

This is more reliable than processFrame as ML Kit can decode the image directly from the file path.

Parameters:

  • filePath: Path to image file (JPEG, PNG, etc.)
  • frameData: Original RGBA frame data for compositing
  • metadata: Image dimensions for mask scaling

Implementation

@override
Future<SegmentationResult> processFile(
  String filePath,
  Uint8List frameData,
  SegmenterInputMetadata metadata,
) async {
  // Stub: just return the frame without processing
  return SegmentationResult(
    processedFrame: frameData,
    mask: null,
    processingTimeMs: 0,
    success: true,
  );
}