alphavalid-sdk 0.0.11 → 0.0.17

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/README.md CHANGED
@@ -71,8 +71,39 @@ Para encerrar:
71
71
  await sdk.stop();
72
72
  ```
73
73
 
74
+ ### Liveness / desafios (opcional)
75
+
76
+ Você pode exigir que só seja considerado **válido olhando para frente**, e/ou definir uma sequência de desafios.
77
+
78
+ ```ts
79
+ await sdk.start({
80
+ container: document.getElementById('cameraContainer')!,
81
+ modelsPath: '/assets/alphavalid-models',
82
+ liveness: {
83
+ requireLookForward: true,
84
+ strictness: 0.5,
85
+ challenges: [
86
+ { type: 'lookForward' },
87
+ { type: 'lookLeft' },
88
+ { type: 'lookRight' },
89
+ { type: 'zoomIn' },
90
+ { type: 'zoomOut' },
91
+ { type: 'blink' }
92
+ ]
93
+ },
94
+ onStateChange: (state) => {
95
+ // habilite o botão de capturar quando state.isReadyToCapture === true
96
+ console.log(state);
97
+ }
98
+ });
99
+ ```
100
+
74
101
  ## Observações
75
102
 
76
103
  - Este MVP faz **detecção** (tem 1 rosto? está centralizado? perto/longe?).
77
104
  - Não é reconhecimento facial (comparar com base de rostos).
78
105
 
106
+ Observações sobre liveness:
107
+ - Tudo aqui é **heurístico (MVP)**. Para liveness robusto, o ideal é um pipeline dedicado.
108
+ - O desafio `blink` usa landmarks (modelo `faceLandmark68TinyNet`).
109
+