一 准备好百度云的开发者账号
- 登录
- 进入控制台
- 人工智能------图像识别
- 创建应用
获取接口需要的参数
查看官网API文档
二 页面布局
文件ai.wxml:
<view class="c1">
<view class="c1-1">
</view>
<button type="primary" size="mini" bindtap="chooseImage">选择图片</button>
<view class="c1-2">
<image src="{
{img}}" mode="widthFix"></image>
<text>颜值:{
{face.beauty}}</text>
<text>年龄:{
{face.age}}</text>
<text>性别:{
{face.gender.type}}</text>
<text>情绪:{
{f