I'm running the following code from the cloud-vision API examples repo. I have followed the instructions here: https://cloud.google.com/vision/docs/quickstart-client-libraries?refresh=1 to set up a service account and authentication, but I still can't successfully execute this function.
async function detectLabels() {
// [START vision_label_detection]
// Imports the Google Cloud client library
const vision = require('@google-cloud/vision');
// Creates a client
const client = new vision.ImageAnnotatorClient();
const fileName = './src/img/wakeupcat.jpg';
// Performs label detection on the local file
const [result] = await client.labelDetection(fileName);
const labels = result.labelAnnotations;
console.log('Labels:');
labels.forEach(label => console.log(label.description));
// [END vision_label_detection]
}
detectLabels();
This gives the following error:
Error: 8 RESOURCE_EXHAUSTED: Quota exceeded for quota metric 'Requests' and limit 'Requests per minute' of service 'vision.googleapis.com' for consumer 'project_number:6579173653'.
The wakupcat.jpg image I'm using is 14kb so it's not the size that's an issue.