本文介紹了小程序?qū)崿F(xiàn)人臉識別功能,分享給大家,具體如下:
文檔中心:https://ai.baidu.com/docs#/Begin/a2bbf4b2
接入流程
1. 按照文檔獲取AppID、API Key、Secret Key,進行Access Token(用戶身份驗證和授權(quán)的憑證)的生成
const getBaiduToken = function () { return new Promise((resolve, reject) => { //自行獲取APIKey、SecretKey const apiKey = APIKey; const secKey = SecretKey; const tokenUrl = `https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=${apiKey}&client_secret=${secKey}`; wx.request({ url: tokenUrl, method: 'POST', dataType: "json", header: { 'content-type': 'application/json; charset=UTF-8' }, success: function (res) { resolve(res); }, fail: function (res) { wx.hideLoading(); wx.showToast({ title: '網(wǎng)絡錯誤,請重試!', icon: 'none', duration: 2000 }) reject(res); }, complete: function (res) { resolve(res); } }) }) }
標題名稱:小程序?qū)崿F(xiàn)人臉識別功能(百度ai)-創(chuàng)新互聯(lián)
當前鏈接:http://m.2m8n56k.cn/article32/dipdpc.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導航、標簽優(yōu)化、定制開發(fā)、網(wǎng)站營銷、品牌網(wǎng)站設計、網(wǎng)站設計公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容