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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ezviz/openplatform-ai-uni

v0.0.1-beta.1

Published

萤石开放平台 AI 组件 uni-app SDK

Readme

萤石开放平台 AI 组件 uni-app SDK

安装

npm install @ezviz/openplatform-ai-uni

注意:本 SDK 暂仅支持 Vue2 。

编译配置

transpileDependencies 配置

在 uni-app 项目根目录创建 vue.config.js 文件,添加如下配置:

module.exports = {
  transpileDependencies: ['@ezviz/openplatform-ai-uni']
}

引入 uni-app 工程

以人脸活体检测组件 FaceLiveness 为例

方式1 - 使用 easycom 引入

配置 pages.json 文件,添加 ezopen- 前缀匹配规则

{
  ...
  "easycom": {
    "autoscan": true,
    "custom": {
      "^ezopen-(.*)": "@ezviz/openplatform-ai-uni/src/components/$1/index.vue"
    }
  },
  ...
}

在业务中使用

<template>
  <view class="content">
    <ezopen-FaceLiveness token="tk...." @complete="onComplete" />
  </view>
</template>

<script>
  export default {
    methods: {
      onComplete(event) {
        console.log(event)
      }
    }
  }
</script>

<style>
  .content {
    width: 100%;
    height: 100vh;
  }
</style>

方式2 - 直接引用组件

<template>
  <view class="content">
    <FaceLiveness token="tk...." @complete="onComplete" />
  </view>
</template>

<script>
  import FaceLiveness from '@ezviz/openplatform-ai-uni/src/components/FaceLiveness/index.vue';
  export default {
    components: {
      FaceLiveness
    },
    methods: {
      onComplete(event) {
        console.log(event)
      }
    }
  }
</script>

<style>
  .content {
    width: 100%;
    height: 100vh;
  }
</style>

小程序合法域名

request

  • https://open.ys7.com

API 说明

FaceLiveness 人脸活体检测组件

属性

| 属性 | 类型 | 是否必填 | 描述 | | --- | --- | --- | --- | | token | String | 是 | 用于请求平台接口的凭证,仅支持tk.开头的小权限 token | | @complete | (event: FaceLivenessCompleteEvent) => void | 是 | 检测完成回调事件,检测是否通过都会触发,回调返回内容说明详见 FaceLivenessCompleteEvent 事件 | | host | String | 否 | 访问萤石开放平台接口的域名,默认为https://open.ys7.com,如需修改,需同步更改小程序合法域名 |

事件

FaceLivenessCompleteEvent | 属性 | 类型 | 描述 | | --- | --- | --- | | pass | Boolean | 是否检测通过 | | reasonCode | String | 错误码1 检测成功-1r 图片r:清晰度小于0.3-2r 图片r:瞳距小于30-3r 图片r:人脸左右偏转角大于60-4r 图片r:人脸上下俯仰角大于40-5r 图片r:活体置信度小于0.3-6r 其他未定义错误信息错误码还包含-1g、-1b等,含义与上述相同,最后一位字母代表不同颜色光下的图片| | reason | String | 错误原因,返回上述错误码定义的信息 | | analysisData | Object | 返回 r、g、b 三色光对应的图像及接口响应数据,当图片检测失败时,对应的数据不会返回 | | analysisData.r | Object | 红光图片的数据,同类型数据还有绿光analysisData.g、蓝光analysisData.b | | analysisData.r.imageData | String | 图片的 base64 编码数据 | | analysisData.r.apiRes | Object | 平台检测接口响应数据,详细信息见接口文档 |

检测是否通过的判断逻辑

  • 清晰度:不低于0.3
  • 瞳距:不低于30
  • 左右偏转角:在 [-60°, 60°]
  • 上下俯仰角:在 [-40°, 40°]
  • 活体置信度阈值:不低于0.3

Release Notes

0.0.1-beta.1

Release Date 2025-07-09

  • 提供人脸活体检测组件 FaceLiveness 。