@azure/ai-vision-face-ui 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FaceLivenessDetector.js +1 -1
- package/README.md +13 -15
- package/package.json +2 -2
package/FaceLivenessDetector.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var t="./";const e=t+"facelivenessdetector-assets/images/Smile.svg",s=t+"facelivenessdetector-assets/images/Brightness.svg",n=t+"facelivenessdetector-assets/images/FaceId.svg",i=t+"facelivenessdetector-assets/images/activeMotionVisualHint.png"
|
|
1
|
+
var t="./";const e=t+"facelivenessdetector-assets/images/Smile.svg",s=t+"facelivenessdetector-assets/images/Brightness.svg",n=t+"facelivenessdetector-assets/images/FaceId.svg",i=t+"facelivenessdetector-assets/images/activeMotionVisualHint.png",a=o;!function(){const t=o,e=c();for(;;)try{if(986462==parseInt(t(248))/1+parseInt(t(250))/2+-parseInt(t(251))/3+parseInt(t(253))/4*(-parseInt(t(249))/5)+-parseInt(t(246))/6+-parseInt(t(255))/7*(parseInt(t(254))/8)+parseInt(t(247))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const r=["ar",a(252),"dv","fa","ha","he","khw","ks","ku","ps","ur","yi"];function o(t,e){const s=c();return(o=function(t,e){return s[t-=246]})(t,e)}function c(){const t=["56kHOHQs","2456550WUYfOM","6460416CCYyHL","1969118baDsrf","235985YYXCie","3125988RTISRp","4877214FdLXGP","arc","44ymZRKK","709144QdGlWo"];return(c=function(){return t})()}const h=l;function u(){const t=["validate","_fontSize","8ZepLLy","_skipInstructions","languageDictionary","_fontFamily","496371ZzDLYx","appendChild","smilePath","loadLanguageDictionary","replace","start","315iADsLM","script","None","statusText","_feedbackMessageStyles","undefined","_locale","Failed to load locale: ","authToken","bind","./facelivenessdetector-assets/i18n/","endsWith","2547937VmiXeW","locale","_userCorrelationId","text","FaceRecoEngineAdapter","cleanup","3328120ttphio","Module","/en.json","includes","function","length","isRtl","6767330qYPCCR","en-US","_languageDictionary","_continueButtonStyles","36gazWIF",".wasm","/facelivenessdetector-assets/js/","brightnessSVGPath","Unexpected","deviceCorrelationId","AzureAIVisionFace.js","9356iWLqqq","buttonStyles","2384486hhbxwY","createElement","skipInstructions","_deviceCorrelationId","disconnectedCallback","AzureAIVisionFace_SIMD.js","isDefined","AzureAIVisionFace","6061170AElFUg","activeMotionVisualHint","_mediaInfoDeviceId"];return(u=function(){return t})()}function l(t,e){const s=u();return(l=function(t,e){return s[t-=236]})(t,e)}!function(){const t=l,e=u();for(;;)try{if(792143==-parseInt(t(251))/1+-parseInt(t(295))/2+parseInt(t(257))/3*(-parseInt(t(293))/4)+parseInt(t(275))/5+-parseInt(t(242))/6+-parseInt(t(269))/7*(-parseInt(t(247))/8)+-parseInt(t(286))/9*(-parseInt(t(282))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();var f=h(239);try{0==WebAssembly[h(245)](new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))&&(f=h(292))}catch(t){f=h(292)}class d extends HTMLElement{constructor(){const t=h;super(),this[t(253)]=e,this[t(256)]=this.start[t(266)](this),this._brightnessImagePath="",this[t(285)]="",this[t(261)]="",this[t(246)]="",this[t(250)]="",this[t(284)]={},this[t(281)]=!1,this[t(263)]=t(283),this._baseAssetsURL="./",this[t(244)]="",this[t(248)]=!0,this[t(237)]="",this[t(271)]="",this[t(240)]=!1,this.isHTMLInit=!1,this.authToken="",this.faceId=n,this[t(243)]=i,this[t(289)]=s}set brightnessImagePath(t){this._brightnessImagePath=t}set fontSize(t){this[h(246)]=t}set fontFamily(t){this[h(250)]=t}set[h(294)](t){this[h(285)]=t}set feedbackMessageStyles(t){this[h(261)]=t}set[h(270)](t){const e=h;this._locale=t,r[e(278)](t)&&(this[e(281)]=!0)}set[h(249)](t){const e=h;this[e(284)]=t||this[e(284)]}set mediaInfoDeviceId(t){this[h(244)]=t}set[h(236)](t){this[h(248)]=t}set[h(291)](t){this._deviceCorrelationId=t}set userCorrelationId(t){this[h(271)]=t}[h(256)]=async t=>{const e=h;return this[e(265)]=t,this[e(240)]=await this.checkModuleDefined(1e3,30),this[e(240)]?(await this[e(254)](),Module[e(256)](this)):new Promise((t,s)=>{const n=e;s({livenessError:n(290),recognitionError:n(259)})})};async connectedCallback(){const t=h;if(this.isConnected&&(typeof Module===t(262)||void 0===Module.FaceRecoEngineAdapter)){const e=this._baseAssetsURL[t(255)](/\/$/,"")+t(288);window[t(276)]={locateFile:function(s,n){const i=t;return s[i(278)](i(241))&&s[i(268)](i(287))?e+s:n+s}};const s=document[t(296)](t(258));s.src=e+f,document.head[t(252)](s)}}[h(238)](){const t=h;typeof Module!==t(262)&&typeof Module[t(274)]===t(279)&&Module[t(274)]()}async[h(254)](){const t=h;if(0===Object.keys(this._languageDictionary)[t(280)]){let e=await fetch(t(267)+this[t(263)]+t(277));if(!e.ok)throw new Error(t(264)+this._locale+" strings file: "+e[t(260)]+".");let s=await e[t(272)]();this[t(284)]=JSON.parse(s)}}async checkModuleDefined(t,e){const s=h;let n=0;for(;n<e;){if(n++,typeof Module!==s(262)&&typeof Module[s(273)]!==s(262))return!0;await new Promise(e=>setTimeout(e,t))}return!1}}function p(){var t=["636824nRjLre","42IqeYDl","1628541vQowzA","define","44emXQVG","717881vsLpRB","210395HvTUxU","6418188ZiPEkL","azure-ai-vision-face-ui","2016188KFeTJf","754670FyMbih","10GqTslk"];return(p=function(){return t})()}var I=g;function g(t,e){var s=p();return(g=function(t,e){return s[t-=451]})(t,e)}!function(){for(var t=g,e=p();;)try{if(667940==-parseInt(t(459))/1+-parseInt(t(451))/2+parseInt(t(456))/3+parseInt(t(458))/4*(parseInt(t(460))/5)+-parseInt(t(455))/6*(-parseInt(t(452))/7)+-parseInt(t(454))/8+parseInt(t(461))/9*(parseInt(t(453))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),customElements[I(457)](I(462),d);export var LivenessStatus;
|
|
2
2
|
(function (LivenessStatus) {
|
|
3
3
|
LivenessStatus["RealFace"] = "RealFace";
|
|
4
4
|
LivenessStatus["SpoofFace"] = "SpoofFace";
|
package/README.md
CHANGED
|
@@ -6,9 +6,8 @@ In this sample, you will learn how to build and run the face liveness detection
|
|
|
6
6
|
|
|
7
7
|
* [Introduction](#introduction)
|
|
8
8
|
* [Prerequisites](#prerequisites)
|
|
9
|
-
* [
|
|
10
|
-
* [
|
|
11
|
-
* [Step 3: Integrate face liveness detector into your own application](#step-3-integrate-face-liveness-detector-into-your-own-application)
|
|
9
|
+
* [Installation](#installation)
|
|
10
|
+
* [Integrate face liveness detector into your own application](#integrate-face-liveness-detector-into-your-own-application)
|
|
12
11
|
* [Obtaining a session token](#obtaining-a-session-token)
|
|
13
12
|
* [Injecting the web component](#injecting-the-web-component)
|
|
14
13
|
* [Deployment](#deployment)
|
|
@@ -28,30 +27,29 @@ In this sample, you will learn how to build and run the face liveness detection
|
|
|
28
27
|
|
|
29
28
|
The Azure AI Vision Face UI Web SDK is a client library intended to enable the integration of the face liveness feature into web-applications. It works seamlessly with Azure AI Face APIs to determine the authenticity of a face in a video stream.
|
|
30
29
|
|
|
31
|
-
* API reference: [AzureAIVisionFaceUI](https://aka.ms/azure-ai-vision-face-liveness-client-sdk-web-api-reference)
|
|
30
|
+
* API reference: [AzureAIVisionFaceUI](https://aka.ms/azure-ai-vision-face-liveness-client-sdk-web-api-reference-modules)
|
|
32
31
|
|
|
33
32
|
## Prerequisites
|
|
34
33
|
|
|
35
34
|
1. An Azure Face API resource subscription.
|
|
36
35
|
2. Install node from https://nodejs.org/en/download/prebuilt-installer
|
|
37
36
|
|
|
38
|
-
##
|
|
37
|
+
## Installation
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
1. Create .npmrc file in root of app folder to pull packages from `https://pkgs.dev.azure.com/msface/SDK/_packaging/AzureAIVision/npm/registry/` registry.
|
|
40
|
+
An example .npmrc file is available here(https://github.com/Azure-Samples/azure-ai-vision-sdk/blob/main/samples/web/angularjs/.npmrc).
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
2. Fetch the base64 access token required in the .npmrc file using the API: [Liveness Session Operations - Get Client Assets Access Token](https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-client-assets-access-token?view=rest-face-v1.3-preview)
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
3. To install the SDK via NPM, run the following command in the root of the app folder:
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
```sh
|
|
47
|
+
npm install @azure/ai-vision-face-ui@latest
|
|
48
|
+
```
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
## Integrate face liveness detector into your own application
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## Step 3: Integrate face liveness detector into your own application
|
|
53
|
-
|
|
54
|
-
First run through the steps in the [SetupEnvironment.md](https://github.com/Azure-Samples/azure-ai-vision-sdk/tree/main/samples/web/SetupEnvironment.md) section to install the npm package.
|
|
52
|
+
First, ensure you have installed the npm package as described in the [Installation](#installation) section.
|
|
55
53
|
|
|
56
54
|
### Obtaining a session token
|
|
57
55
|
|
package/package.json
CHANGED