faceapi人脸识别是否是同一人

代码语言:html

所属分类:其他

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>BFW NEW PAGE</title>
    <script id="bfwone" data="dep=face-api&err=0" type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/bfwone.js"></script>
    <script type="text/javascript">
        bready(function() {

            const referinput = document.getElementById('referimg');
            const queryinput = document.getElementById('queryimg');
             const status = document.getElementById('status');
            var  init = async function() {

                await faceapi.nets.ssdMobilenetv1.loadFromUri('https://justadudewhohacks.github.io/face-api.js/models');
                await faceapi.nets.faceLandmark68Net.loadFromUri('https://justadudewhohacks.github.io/face-api.js/models');
                await faceapi.nets.faceRecognitionNet.loadFromUri('https://justadudewhohacks.github.io/face-api.js/models');
                console.log("load model complete");
                status.innerHTML="模型加载完毕,开始识别";
                

                // await faceapi.nets.faceRecognitionNet.loadFromUri('/bfwrepo/model');
                const results = await faceapi
                .detectAllFaces(referinput)
                .withFaceLandmarks()
                .withFaceDescriptors()
                console.log(results);
                if (!results.length) {
                    return
       .........完整代码请登录后点击上方下载按钮下载查看

网友评论0