AI Face Detect API

安装

npm install @cutos/core

npm install @cutos/devices

引入依赖
import {CoreAPI} from '@cutos/core';
import {DeviceCutosAi} from './js/device-cutos-ai.js';

DeviceCutosAi

构造函数, 创建AI实例

let device = new DeviceCutosAi(name, callback, [opts]);
  • name: 名称
  • callback: 回调函数
  • opts:可选参数,
    • wrtc: 默认为true,建立WebRTC数据通道,用于接收人脸检测结果
    • development: 默认为true。
举例:
device = new DeviceCutosAi('device-cutos-ai', ({result, msg}) => {
    console.log("device cutos ai init", result, msg ? " error:" + msg : "");
});

compareWithUrls

比对人脸图像地址

device.compareWithUrls(imgUrl1, imgUrl2, callback);
举例:
const imgUrl1 = 'http://192.168.1.6/documents/rr1.png';
const imgUrl2 = 'http://192.168.1.6/documents/rr3.png';
device.compareWithUrls(imgUrl1, imgUrl2, (result) => {
    console.log("compareWithUrls: ", result)
});

compareWithImgs

比对人脸图像

device.compareWithImgs(img1, img2, callback)
举例:
device.compareWithImgs(blobImg1, blobImg2, (result) => {
    console.log("compareWithImgs: ", result)
});

results matching ""

    No results matching ""