Skip to content

Commit 17b4d1a

Browse files
author
dongfengtao
committed
fix: 活体检测 修改打包方式-验证版本20
1 parent 296dd7d commit 17b4d1a

3 files changed

Lines changed: 48 additions & 199 deletions

File tree

packages/guard-core-v4/package-lock.json

Lines changed: 36 additions & 195 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/guard-core-v4/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"@aws-amplify/ui-react": "^6.15.2",
2323
"@aws-amplify/ui-react-liveness": "^3.6.2",
2424
"@github/webauthn-json": "^2.1.1",
25-
"@tensorflow/tfjs-backend-cpu": "^4.22.0",
26-
"@tensorflow/tfjs-backend-wasm": "^4.22.0",
27-
"@tensorflow/tfjs-converter": "^4.22.0",
28-
"@tensorflow/tfjs-core": "^4.22.0",
25+
"@tensorflow/tfjs-backend-cpu": "4.11.0",
26+
"@tensorflow/tfjs-backend-wasm": "4.11.0",
27+
"@tensorflow/tfjs-converter": "4.11.0",
28+
"@tensorflow/tfjs-core": "4.11.0",
2929
"authing-js-sdk": "4.23.50",
3030
"aws-amplify": "^6.16.3",
3131
"classnames": "^2.3.1",

packages/guard-core-v4/src/MFA/core/AwsFaceLivenessDetector.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ import React, { useEffect, useState } from 'react'
77
// 这样可以避免使用方遇到 chunk 加载问题
88
// ============================================
99

10+
// 配置 TensorFlow.js WASM 后端路径
11+
import { setWasmPaths } from '@tensorflow/tfjs-backend-wasm'
12+
13+
// 使用 CDN 路径加载 WASM 文件(版本需与 ui-react-liveness 依赖一致)
14+
setWasmPaths(
15+
'https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@4.11.0/dist/'
16+
)
17+
1018
import {
1119
FaceLivenessDetectorCore,
1220
AwsCredentialProvider

0 commit comments

Comments
 (0)