setLabels method

Future<void> setLabels(
  1. List<String>? labels
)

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).

Implementation

Future<void> setLabels(List<String>? labels) async {
  await _methodChannel.invokeMethod('setLabels', {'labels': labels});
}