# api_ai_ml **Repository Path**: mo-huimin/api_ai_ml ## Basic Information - **Project Name**: api_ai_ml - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-03-22 - **Last Updated**: 2024-11-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # API期末项目 | 项目名称 | 爱人爱车产品需求文档 | | -------- | ------------------------------------------------------------ | | 产品名称 | 爱人爱车 | | 产品描述 | 一款扫描识别车型的小程序,识别车辆的具体车型,以小汽车为主,输出图片中主体车辆的品牌、型号、年份、颜色、百科词条信息;可识别三千款常见车型,准确率90%以上。同时还提供了识别车辆外观受损部件及损伤类型的功能,支持32种车辆部件、5大类外观损伤。可输出损伤的数值化结果(长宽、面积、部件占比),支持单图多种损伤的识别。 | | 产品版本 | 1.0 | | 文档作者 | 莫慧敏 | ![输入图片说明](week19_%E6%9C%9F%E6%9C%AB%E9%A1%B9%E7%9B%AE/%E7%88%B1%E4%BA%BA%E7%88%B1%E8%BD%A6.png) ## 一、价值宣言 在日常生活中,小汽车是我们常用的交通工具之一。各大汽车公司大力推出的越来越多车型,路上行驶着各式各样新款旧款车,有些可能是大众所熟知的,有些可能是小众的,一些对车品牌型号不了解的人可能有惑于此,对于一些社恐人士来说,会相对于来说比较恐惧直接开口问别人。所以,一句话概括来说,就是许多人对于小汽车识别的需求是非常广的,这也就是说对小汽车识别的小程序还是有需求的。 ## 二、问题表述 ### 2.1产品背景 随着人工智能技术快速发展,越来越多的先进技术被运用于生活中,爱人爱车小程序是一款利用人工智能技术快速识别车型并且提供小汽车损伤程度鉴定的小程序,后期为用户搭建了一个持续性更强的社交平台,用户可以寻求专家帮忙鉴定,或替其他用户鉴定系统未能成功识别的车型以及初步鉴定车辆损伤类型等等。在爱人爱车小程序中,可以鉴别出大部分小汽车车型,亦可以识别出车辆损伤程度。 ### 2.2产品市场 为对于小汽车有浓厚的兴趣爱好者提供有关车型以及相似车型的百度百科的资料,让用户更加容易了解相关车型,与其他志同道合者互相分享经验。为小汽车损伤鉴定提供一个参考途径,让用户了解到相关损伤类型。 ### 2.3用户痛点 | 用户群体 | 用户痛点 | | ------------------ | ---------------------------------------- | | 刚对车有兴趣的群体 | 不能随时随地询问他人某车辆车型 | | 低龄儿童父母 | 无法为孩子提供准确的答案满足孩子的好奇心 | | 新手司机 | 未能通过肉眼识别车辆损伤类型 | ### 2.4用户画像与使用场景 ![输入图片说明](week19_%E6%9C%9F%E6%9C%AB%E9%A1%B9%E7%9B%AE/%E7%94%A8%E6%88%B7%E7%94%BB%E5%83%8F/%E7%94%A8%E6%88%B7%E7%94%BB%E5%83%8F1.jpg) ![输入图片说明](week19_%E6%9C%9F%E6%9C%AB%E9%A1%B9%E7%9B%AE/%E7%94%A8%E6%88%B7%E7%94%BB%E5%83%8F/%E7%94%A8%E6%88%B7%E7%94%BB%E5%83%8F2.jpg) ![输入图片说明](week19_%E6%9C%9F%E6%9C%AB%E9%A1%B9%E7%9B%AE/%E7%94%A8%E6%88%B7%E7%94%BB%E5%83%8F/%E7%94%A8%E6%88%B7%E7%94%BB%E5%83%8F3.JPG) ## 三、解决方案表述 ### 3.1 API产品对比 | API平台 | 产品名 | 价格 | 请求参数 | | ---------- | ---------------- | --------------- | --------------------------- | | 百度智能云 | 车型识别 | 10万次/280元 | image/url/top_num/baike_num | | 聚合数据 | 车型识别 | 20万次/1000元 | image/key | | 百度智能云 | 车辆外观损伤识别 | 10万次/140000元 | image/url | ### 3.2 编程功能的基本描述 > 车型识别API接口调用展示 请求数据 ``` onLoad(options) { var that = this console.log("--------options_CV-----------:", options) that.setData({ user_img: options.user_image }) // 0. 读取图片的base64文件内容 wx.getFileSystemManager().readFile({ filePath: options.user_image, //选择图片返回的相对路径 encoding: 'base64', //编码格式 success(res) { console.log('data:image/png;base64,' + res.data) //成功的回调 that.setData({ base64_img: 'data:image/png;base64,' +res.data }) // 1. 获取百度AI开放平台的 token wx.request({ url: 'https://aip.baidubce.com/oauth/2.0/token', //仅为示例,并非真实的接口地址 data: { grant_type: 'client_credentials', client_id: 'xK25N8NYHyfFpUhKf6qo6duh', client_secret: 'QF7OTiWwXQ8uTzIuqrz1p7xtrbDGnrfr' }, header: { 'content-type': 'application/json' // 默认值 }, success(res) { console.log(res.data) that.setData({ access_token:res.data.access_token }) console.log(that.data.access_token) // 2. 获取图片识别的数据 wx.request({ url: 'https://aip.baidubce.com/rest/2.0/image-classify/v1/car', //百度AI-图像识别-车型识别的URL data: { access_token: that.data.access_token, image: that.data.base64_img, baike_num: 5 }, header: { 'content-type': 'application/x-www-form-urlencoded' // 默认值 }, method:"POST", success(res) { console.log(res.data) that.setData({ car_result: res.data.result }) } }) } }) } }) }, ``` 返回数据 ``` {location_result: {…}, color_result: "黄色", result: Array(5), log_id: 1546671506939127000} color_result: "黄色" location_result: height: 589 left: 194 top: 249 width: 1310 __proto__: Object log_id: 1546671506939127000 result: Array(5) 0: {year: "2012-2016", name: "迈凯伦P", score: 0.9015193581581116, baike_info: {…}} 1: {year: "2015-2017", name: "迈凯伦570S", score: 0.008602280169725418, baike_info: {…}} 2: {year: "2017", name: "迈凯伦675LT", score: 0.005089507438242435, baike_info: {…}} 3: {year: "2017", name: "丰田塞纳", score: 0.004075115546584129, baike_info: {…}} 4: {year: "2015", name: "迈凯伦625C", score: 0.003973848186433315, baike_info: {…}} length: 5 nv_length: (...) __proto__: Array(0) __proto__: Object ``` > 车辆外观损伤识别API接口调用展示 请求数据 ``` onLoad(options) { var that = this console.log("--------options_CV-----------:", options) that.setData({ user_img: options.user_image }) // 0. 读取图片的base64文件内容 wx.getFileSystemManager().readFile({ filePath: options.user_image, //选择图片返回的相对路径 encoding: 'base64', //编码格式 success(res) { console.log('data:image/png;base64,' + res.data) //成功的回调 that.setData({ base64_img: 'data:image/png;base64,' +res.data }) // 1. 获取百度AI开放平台的 token wx.request({ url: 'https://aip.baidubce.com/oauth/2.0/token', //仅为示例,并非真实的接口地址 data: { grant_type: 'client_credentials', client_id: 'xK25N8NYHyfFpUhKf6qo6duh', client_secret: 'QF7OTiWwXQ8uTzIuqrz1p7xtrbDGnrfr' }, header: { 'content-type': 'application/json' // 默认值 }, success(res) { console.log(res.data) that.setData({ access_token:res.data.access_token }) console.log(that.data.access_token) // 2. 获取图片识别的数据 wx.request({ url: 'https://aip.baidubce.com/rest/2.0/image-classify/v1/vehicle_damage', //百度AI-图像识别-车辆外观损伤识别的URL data: { access_token: that.data.access_token, image: that.data.base64_img }, header: { 'content-type': 'application/x-www-form-urlencoded' // 默认值 }, method:"POST", success(res) { console.log(res.data) that.setData({ damage_result: res.data.result }) } }) } }) } }) }, ``` 返回数据 ``` {result: {…}, log_id: 1546673093990552300} log_id: 1546673093990552300 result: damage_info: Array(2) 0: {probability: 89, parts: "后保险杠", type: "刮擦"} 1: {probability: 47, parts: "右后叶子板", type: "刮擦"} length: 2 nv_length: (...) __proto__: Array(0) __proto__: Object __proto__: Object ``` ### 3.3产品UI界面展示 ![输入图片说明](week19_%E6%9C%9F%E6%9C%AB%E9%A1%B9%E7%9B%AE/%E7%95%8C%E9%9D%A2/IMG.JPG) ## 四、产品结构图 ![输入图片说明](week19_%E6%9C%9F%E6%9C%AB%E9%A1%B9%E7%9B%AE/%E4%BA%A7%E5%93%81%E7%BB%93%E6%9E%84%E5%9B%BE.png) ## 五、学习、实践心得总结感谢 经过一学期的api课程学习,感觉自己受益匪浅,从一开始高德地图的周边搜索到后来的百度AI智能云的人脸识别和图像识别等api接口学习,都让我进一步了解到以后作为一个产品经理应该如何与前后端对接。虽然学识尚浅,但所学到的收益绝不仅仅是api接口连接,更有小程序相关知识,并且了解到如何搜索查找相关资料。 在学习与实践过程中非常感谢纪冰儿同学的大力相助与及时交流解惑,让我不至于在知识的海洋中迷路,更感谢许智超老师的悉心指导与教诲。更感谢在这信息时代,各种网络咨询的帮助,其中CSDN给我的帮助是最大的,几乎所有问题都能被各大网友解开,在此平台上提问也能被及时回复,日后定会努力学习相关内容,争取做一个合格优秀的产品经理。
参考文档 * [期末要求](https://gitee.com/xzhichao/api_ai_ml/blob/master/%E6%9C%9F%E6%9C%AB%E9%A1%B9%E7%9B%AE%E8%A6%81%E6%B1%82.md) * [京东万象](https://wx.jdcloud.com/) * [百度AI开放平台车型识别](https://ai.baidu.com/tech/vehicle/car) * [百度AI开放平台车辆外观损伤识别](https://ai.baidu.com/tech/vehicle/damage) * [聚合数据车型识别](https://www.juhe.cn/docs/api/id/371) * [PRD:倒推知乎APP需求文档](https://www.woshipm.com/evaluating/4428865.html) * [uni-app、微信小程序基础布局CSS](https://blog.csdn.net/weixin_43829719/article/details/102967692?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165736342716781818785316%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=165736342716781818785316&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~pc_rank_34-1-102967692-null-null.142^v32^pc_rank_34,185^v2^control&utm_term=padding-bottom-xs&spm=1018.2226.3001.4187) * [微信小程序云开发](https://so.csdn.net/so/search?q=%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%BA%91%E5%BC%80%E5%8F%91&t=&u=&utm_term=%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%BD%99%E9%A2%9D%E4%B8%8D%E8%B6%B3&request_id=165691188016781683984622&opensearch_request_id=165691188016781683984622&urw=) * [【python基础】列表定义、取值、常用方法详解](https://blog.csdn.net/QA_apan/article/details/108232132?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165686409216781435466271%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=165686409216781435466271&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-2-108232132-null-null.142^v30^pc_rank_34,185^v2^control&utm_term=python+%E5%88%97%E8%A1%A8%E5%8F%96%E5%80%BC&spm=1018.2226.3001.4187) * [微信小程序:Array数组的操作](https://blog.csdn.net/wujakf/article/details/102975116)