boundingBoxLabelsByFilter method
- Filter? filter
Returns a list of bounding box labels based on a filter.
If no filter
is provided, all labels will be returned.
_viam = await Viam.withApiKey(
dotenv.env['API_KEY_ID'] ?? '',
dotenv.env['API_KEY'] ?? ''
);
final dataClient = _viam.dataClient;
try {
// Create a filter to target specific binary data
final filter = Filter(
componentName: "camera-1",
);
// Call the function to get bounding box labels by filter
final labels = await dataClient.boundingBoxLabelsByFilter(filter);
print('Successfully got bounding box labels: $labels');
} catch (e) {
print('Error getting bounding box labels: $e');
}
For more information, see Data Client API.
Implementation
Future<List<String>> boundingBoxLabelsByFilter(Filter? filter) async {
final request = BoundingBoxLabelsByFilterRequest()..filter = filter ?? Filter();
final response = await _dataClient.boundingBoxLabelsByFilter(request);
return response.labels;
}