chenyc
2025-06-30 d518ec81bbdb5f9f66584609bf5ae4c18347cd59
gx本地人脸识别匹配百度sdk
3个文件已修改
10个文件已删除
22 ■■■■ 已修改文件
imgs/1732850057688.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1732850063439.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1745300147337.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1747871314850.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1747872961935.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1747872963959.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1747872966020.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1747900669498.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1747955547919.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1747959861905.png 补丁 | 查看 | 原始文档 | blame | 历史
src/api/user/index.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/samples/faceApi.ts 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1732850057688.png
Binary files differ
imgs/1732850063439.png
Binary files differ
imgs/1745300147337.png
Binary files differ
imgs/1747871314850.png
Binary files differ
imgs/1747872961935.png
Binary files differ
imgs/1747872963959.png
Binary files differ
imgs/1747872966020.png
Binary files differ
imgs/1747900669498.png
Binary files differ
imgs/1747955547919.png
Binary files differ
imgs/1747959861905.png
Binary files differ
src/api/user/index.ts
@@ -41,7 +41,7 @@
}
export function checkUploadFile(params: Object) {
    return request({
        url: `${confingInfoStore().confingInfo.faceApi}/check-face`,
        url: `${confingInfoStore().confingInfo.faceApi}/test/identifyFace`,
        method: 'post',
        data: params,
    })
src/samples/faceApi.ts
@@ -139,18 +139,18 @@
      let blobFile = new File([data], 'name.png', {type:"image/png"})
      console.log(blobFile)
      const formData = new FormData() // 下面有备注
      formData.append('file', blobFile)
      formData.append('image', blobFile)
      checkUploadFile(formData).then(re=>{
          console.log('-----',re)
          if(re.code===200&&re?.result?.length>0){
            const result=re.result[0]
            const entityId=result._label
            const distance=result._distance
          if(re.code===200&&re?.data?.data.result.length>0&&re?.data?.data.result[0]){
            const result=re?.data?.data.result[0]
            const entityId=result.user_id
            const distance=result.score
            console.log(`entityId=`+entityId+','+'distance='+distance)
            // 设置识别的的两 要大于多少
            if(entityId!=='unknown'&&distance<=faceScore){
            //设置识别的的两 要大于多少
            if(entityId!=='unknown'&&distance>=faceScore){
              console.log(entityId,'得到了人脸识别id,存患者code到vuex')
              // console.log(entityId,'得到了人脸识别id,存患者code到vuex')
              console.log(entityId,'得到了人脸识别id,存患者code到vuex')
              sockteStore().setfaceSockte({
                type: "人脸识别",
                deviceName: "人脸识别",
@@ -159,7 +159,7 @@
                state:2,
              })
            }
          //
          }else{
            console.log('本地没识别')
          }
src/views/home/index.vue
@@ -1205,7 +1205,7 @@
  canvas.height = video.videoHeight
  // 参数:图片,裁剪开始x坐标,裁剪开始y坐标,裁剪宽度,裁剪高度,目标x坐标,目标y坐标,目标宽度,目标高度
  // context.drawImage(image, 100, 100, 200, 200, 0, 0, 200, 200);
  canvas.getContext('2d')?.drawImage(video, startPoint.x-10,startPoint.y-10,width+20,height+20,0,0,width+10,height+10)
  canvas.getContext('2d')?.drawImage(video, startPoint.x-20,startPoint.y-20,width+60,height+60,20,20,width+60,height+60)
  const imgSrc = canvas?.toDataURL('image/png');
  return imgSrc