ImageAnnotatorClient谷歌视觉API

时间:2018-01-17 15:11:23

标签: google-cloud-platform vision-api

尝试使用node使用vision api运行标签检测:

msgsnd

连续收到错误:“未定义ImageAnnotatorClient” 有什么理由吗?

1 个答案:

答案 0 :(得分:2)

您可以尝试修改该行:

    console.log(serverUrl);
    let headers = this.createRequestHeader();
    let token_value = localStorage.getItem('access_token')

    let url;
    var filter;

    filter = '{"limit":"10","skip":"0"}'



    url = this.apiUrl + serverUrl + '?token=' + token_value + '&filter=' + filter

    return this.http.get(url, { headers: headers })
        .map(res => res.json());
}

有:

const client = new ImageAnnotatorClient({

ImageAnnotatorClient方法是从您导入为const client = new vision.ImageAnnotatorClient({ 变量的Cloud Vision API中提取的。