npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

face-detection-for-aopeng

v1.5.8

Published

Version:1.5.8

Downloads

9

Readme

活体检测&人脸识别 SDK

Version:1.5.5

安装使用

npm install face-detection --save(请使用open源,具体操作见:http://gitlab.open.com.cn/fontend/blog/issues/3)

script标签引用方法(同时支持AMD与CMD)

    <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <!--[if IE]><script src="js/excanvas.js"></script><![endif]-->

获取‘face-detection/dist/faceDetection.js’文件,‘face-detection/dist/faceDetection.css’获取css文件,分别单独引入 在脚本中应用sdk

    <div id="INTELLIGENT_DETECTION"></div>
    <script type="text/javascript">
        openSDK.faceDetection({
            配置项
        }, function(backObj) {
            let curModel = 2; //curModel:0>面部识别;curModel:1>活体检测;curModel:2>拍照
            let cancelBtn = document.getElementById('FaceCancelBtn'); //取消按钮
            let shotBtn = document.getElementById('FaceShotBtn'); //拍摄按钮
            let checkBtn = document.getElementById('FaceCheckBtn'); //检测按钮
            let distinguishBtn = document.getElementById('FaceDistinguishBtn'); //识别按钮
            let retryBtn = document.getElementById('FaceRetryBtn'); //重试按钮
            let nextBtn = document.getElementById('FaceNextBtn'); //下一步按钮
            let completeBtn = document.getElementById('FaceCompleteBtn'); //完成按钮
            callBackObj = backObj;
            //提示框信息
            backObj.promptMsgModel(0, '保持人在拍摄框内,且只有一个人');
            //拍摄
            shotBtn.onclick = function() {
                backObj.shotModel(function(callPic) {
                    //backObj.resultModel(true, '拍摄成功');
                })
            }
            //重试
            retryBtn.onclick = function() {
                backObj.retryModel(0, function(callPic) {
                    //backObj.resultModel(true, '重试成功');
                })
            }
            //下一步
            nextBtn.onclick = function() {
                backObj.nextModel(1)
            }
            //人脸识别
            distinguishBtn.onclick = function() {
                backObj.distinguishModel(function(callPic) {
                    backObj.resultModel(false, '识别失败');
                    // backObj.resultModel(true, '识别成功',false);
                })
            }
            //活体检测
            checkBtn.onclick = function() {
                backObj.checkModel(function(callPic) {
                    // backObj.resultModel(false, '检测失败');
                    // backObj.resultModel(true, '检测成功');
                })
            }
            //完成
            completeBtn.onclick = function() {
                backObj.completeModel(function() {
                    console.log('完成了')
                })
            }
        })
    </script>

import 引入 例Vue

<template>
	<div class="box_name">
		<div id="INTELLIGENT_DETECTION"></div>
	</div>
</template>

<script>
  import {openSDK} from 'face-detection'
  import 'face-detection/dist/faceDetection.css'
  export default {
  name: 'HelloWorld',
  data () {
    return {
    }
  },
  created () {
    调用方法同上
  }
}
</script>

参数配置

    width: 340, //宽度,默认340
        height: 255, //高度,默认255
        quality: 80, //图片质量,默认80
        checkType: "Mouth", //检测类型 Mouth:张嘴/闭嘴  Eye:睁眼/闭眼   默认为Mouth
        // 张嘴/闭嘴检测模式
        checkMouth: {
            checkPicNum: 5,
            checkInterval: 500
        },
        // 睁眼/闭眼检测模式
        checkEye: {
            checkPicNum: 10,
            checkInterval: 200
        },
        btnColor: '#278ed0', //按钮颜色
        // browserUpgradeTip // 浏览器升级提示(不传用默认值)
        defaultReminder: '保持人在拍摄框内,且只有一个人',
        sort: true, //true:人脸识别>活体检测;false:活体检测>人脸识别;**:人脸识别和活体检测同时开启才起作用
        isRetain: false, //判断用户中心是否有底图,没有需要拍照,默认为false,不需要拍摄
        faceRecognit: false, //人脸识别模块停用||启用
        livingDetection: false, //活体检测模块停用||启用
        isOprationPrompt: true, // 是否显示操作提示(默认显示)
        isCancelBtn: true, // 是否显示取消按钮(默认显示)
        detectSamplePictures: { //检测模块示例图
            defaultStatusPic: 'https://fedcdn.open.com.cn/fedcdn/Face/defaultimg.jpg', //默认状态图片
            openMouthPic: 'https://fedcdn.open.com.cn/fedcdn/Face/openmouth.jpg', //张嘴图片
            closeMouthPic: 'https://fedcdn.open.com.cn/fedcdn/Face/closemouth.jpg', //闭嘴图片
            openEyePic: "https://fedcdn.open.com.cn/fedcdn/Face/openeye.jpg", //睁眼图片
            closeEyePic: "https://fedcdn.open.com.cn/fedcdn/Face/closeeye.jpeg" //闭眼图片
        },
        // 按钮重定义名字
        btnRsetName: [{
            id: 'FaceCheckBtn',
            name: '开始检测'
        }],
        // 语言
        language:"Chinese" //默认中文, 可选择英文(English)和泰文(Thai)
    *:当前模块为最后一个模块时,调用resultModel方法时需要传递第三个参数-false