uniapp+vue3+ts+百度人脸检测

百度人脸检测:https://console.bce.baidu.com/ai/?fromai=1#/ai/face/overview/index

免费资源包用完需要付费。

1、百度开通人脸检测

创建应用:https://console.bce.baidu.com/ai/?fromai=1#/ai/face/app/list

新建组->新建用户

实名认证->领取“人脸检测”资源:https://console.bce.baidu.com/ai/#/ai/face/overview/resource/getFree

2、uni
微信小程序:uni.createCameraContext()

0、展示

<up-modal :show="show"  title="人脸检测" @confirm="close()">
			<view class="slot-content">
                <!-- "front"表示使用前置摄像头、"back"表示使用后置摄像头,高度不能太小 -->
				<camera device-position="front" flash="off" style="width: 300px; height: 300px;border-radius: 50%;"></camera>
</view>
</up-modal>

// 使用 reactive 创建响应式状态
const state = reactive({
    baiduApiData: {
        apikey: '', // 创建应用时生成
        SecretKey: '' // 创建应用时生成
    },
    access_token: '',
    base64Img: '',
    // 检测到人脸的照片
    baseImage: ''
});

// 弹窗
const show = ref(false); 
const close = () => {
    sh
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值