facecog-liveness-showcase 0.0.1
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/.browserslistrc +15 -0
- package/.dockerignore +48 -0
- package/.editorconfig +16 -0
- package/.eslintrc.json +47 -0
- package/.vercelignore +7 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +3 -0
- package/DOCKER.md +221 -0
- package/Dockerfile +33 -0
- package/README.md +268 -0
- package/angular.json +156 -0
- package/capacitor.config.ts +9 -0
- package/docker-compose.dev.yml +20 -0
- package/docker-compose.yml +18 -0
- package/ionic.config.json +7 -0
- package/jest.config.js +38 -0
- package/nginx.conf +50 -0
- package/package.json +131 -0
- package/patches/ng-packagr+20.3.2.patch +60 -0
- package/projects/facecog-liveness-verification/README.md +295 -0
- package/projects/facecog-liveness-verification/ng-package.json +7 -0
- package/projects/facecog-liveness-verification/package.json +48 -0
- package/projects/facecog-liveness-verification/scripts/build-with-wrapper-copy.js +38 -0
- package/projects/facecog-liveness-verification/scripts/copy-wrapper-after-ngc.js +35 -0
- package/projects/facecog-liveness-verification/sources/FaceLivenessReactWrapper.tsx +320 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.d.ts +28 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js +247 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/aws-face-liveness.component.ts +500 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.html +41 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.scss +234 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.spec.ts +158 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.ts +58 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.html +34 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.ts +210 -0
- package/projects/facecog-liveness-verification/src/lib/components/dialogs/save-custom-pose-dialog.component.ts +174 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.html +45 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.scss +87 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.ts +182 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.html +394 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.scss +1567 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.spec.ts +699 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.ts +721 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.html +120 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.scss +611 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.spec.ts +605 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.ts +524 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.html +73 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.scss +19 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.spec.ts +673 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.ts +963 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.html +38 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.scss +10 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.ts +233 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.spec.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.ts +33 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.scss +156 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.spec.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.html +190 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.scss +534 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.spec.ts +286 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/analyze-response.interface.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/aws-face-liveness.interface.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-adapter.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-http-client.interface.ts +93 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-response.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/camera-provider.interface.ts +107 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/category-info.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-data.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-repository.interface.ts +48 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-response.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/index.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-action-result.interface.ts +13 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-config.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-metadata.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-result.interface.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-verification-config.interface.ts +41 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-analyze-response.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-liveness-result.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-definition.interface.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-keypoint.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-match-result.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-verify-response.interface.ts +8 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/scan-results.interface.ts +29 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-plan.interface.ts +42 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-progress-event.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-session.interface.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-step-change-event.interface.ts +11 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/video-recording.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/liveness-verification.module.ts +123 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/aws-face-liveness-component.token.ts +23 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/category-info.constant.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/default-liveness-config.constant.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/liveness-verification-config.token.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/pose-definitions.constant.ts +377 -0
- package/projects/facecog-liveness-verification/src/lib/models/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/index.ts +2 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.spec.ts +76 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.ts +59 -0
- package/projects/facecog-liveness-verification/src/lib/services/aws-face-liveness.service.ts +49 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.spec.ts +111 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.ts +130 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.spec.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.spec.ts +36 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.ts +39 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.spec.ts +81 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.ts +83 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.spec.ts +200 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/services/custom-poses-api.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/services/index.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.spec.ts +103 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.ts +61 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.spec.ts +109 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.ts +70 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.spec.ts +144 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.ts +162 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/hand-gesture-detection.service.ts +315 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/openpose.service.ts +287 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-comparison.service.ts +353 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-matching.service.ts +2370 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/reference-pose.service.ts +271 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.spec.ts +183 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.ts +179 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.spec.ts +159 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.ts +151 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.spec.ts +184 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.ts +94 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.spec.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/types/detection-strategy.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/index.ts +7 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-action.type.ts +31 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-backend.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-category.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-difficulty.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-flow-step.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-step-kind.type.ts +4 -0
- package/projects/facecog-liveness-verification/src/public-api.ts +150 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.json +20 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.prod.json +11 -0
- package/projects/facecog-liveness-verification/tsconfig.spec.json +13 -0
- package/projects/facecog-liveness-verification/tsconfig.wrapper.json +15 -0
- package/projects/facecog-liveness-verification-test/src/app/app-routing.module.ts +22 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.html +3 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.scss +0 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.ts +11 -0
- package/projects/facecog-liveness-verification-test/src/app/app.module.ts +27 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home-routing.module.ts +16 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.module.ts +19 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.html +39 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.scss +97 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.spec.ts +24 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.ts +92 -0
- package/projects/facecog-liveness-verification-test/src/app/home/verification-modal.component.ts +106 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Bold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Medium_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Regular_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-SemiBold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Thin_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/icon/favicon.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Five_Fingers_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Left_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Ok_Sign_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Peace_Sign_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/README.md +77 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Right_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Speak_Phrase.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Three_Fingers_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Wave_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink_twice.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/center_face.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/clap.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_right_eye.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cross_arms.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/face_straight.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/follow_dot.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_down.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_up.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/move_closer.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/nod.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/open_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/raise_eyebrow.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/rotate_face.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/shake_head.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/smile.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_chin_left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_left_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_nose_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_right_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/wink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/reference-pose.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/shapes.svg +1 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.prod.ts +4 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.ts +17 -0
- package/projects/facecog-liveness-verification-test/src/global.scss +288 -0
- package/projects/facecog-liveness-verification-test/src/index.html +31 -0
- package/projects/facecog-liveness-verification-test/src/main.ts +6 -0
- package/projects/facecog-liveness-verification-test/src/polyfills.ts +55 -0
- package/projects/facecog-liveness-verification-test/src/theme/nextsapien-theme.scss +174 -0
- package/projects/facecog-liveness-verification-test/src/theme/variables.scss +2 -0
- package/projects/facecog-liveness-verification-test/src/zone-flags.ts +6 -0
- package/projects/facecog-liveness-verification-test/tsconfig.app.json +15 -0
- package/projects/facecog-liveness-verification-test/tsconfig.spec.json +14 -0
- package/setup-jest.ts +118 -0
- package/tsconfig.json +41 -0
- package/tsconfig.spec.json +15 -0
- package/vercel.json +24 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { HomePage } from './home.page';
|
|
5
|
+
|
|
6
|
+
describe('HomePage', () => {
|
|
7
|
+
let component: HomePage;
|
|
8
|
+
let fixture: ComponentFixture<HomePage>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule({
|
|
12
|
+
declarations: [HomePage],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(HomePage);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { IonicModule, ModalController } from '@ionic/angular';
|
|
5
|
+
import {
|
|
6
|
+
LivenessConfigService,
|
|
7
|
+
LivenessResult,
|
|
8
|
+
PoseSelectionService,
|
|
9
|
+
PoseDefinition
|
|
10
|
+
} from '@naniteninja/liveness-verification';
|
|
11
|
+
import { VerificationModalComponent } from './verification-modal.component';
|
|
12
|
+
|
|
13
|
+
const SAMPLE_POSE_IMAGE_DATA = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==';
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'app-home',
|
|
17
|
+
templateUrl: 'home.page.html',
|
|
18
|
+
styleUrls: ['home.page.scss'],
|
|
19
|
+
standalone: true,
|
|
20
|
+
imports: [CommonModule, FormsModule, IonicModule]
|
|
21
|
+
})
|
|
22
|
+
export class HomePage {
|
|
23
|
+
lastResult: LivenessResult | null = null;
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
private modalCtrl: ModalController,
|
|
27
|
+
private configService: LivenessConfigService,
|
|
28
|
+
private poseSelectionService: PoseSelectionService
|
|
29
|
+
) {}
|
|
30
|
+
|
|
31
|
+
async openVerificationModal(): Promise<void> {
|
|
32
|
+
this.configService.updateConfig({
|
|
33
|
+
backends: ['mock'],
|
|
34
|
+
enableVideoRecording: true,
|
|
35
|
+
autoCapture: true,
|
|
36
|
+
showIntroScreen: true,
|
|
37
|
+
captureFrameCount: 5
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const modal = await this.modalCtrl.create({
|
|
41
|
+
component: VerificationModalComponent,
|
|
42
|
+
componentProps: { poseSpecific: false },
|
|
43
|
+
cssClass: 'verification-modal'
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
await modal.present();
|
|
47
|
+
const { data } = await modal.onDidDismiss();
|
|
48
|
+
if (data) {
|
|
49
|
+
this.lastResult = data;
|
|
50
|
+
console.log('[Showcase] Modal result:', data);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async openPoseSpecificModal(): Promise<void> {
|
|
55
|
+
const customPose: PoseDefinition = {
|
|
56
|
+
id: -1,
|
|
57
|
+
name: 'Smile',
|
|
58
|
+
description: 'Please smile at the camera to verify your identity',
|
|
59
|
+
category: 'face',
|
|
60
|
+
imagePath: SAMPLE_POSE_IMAGE_DATA,
|
|
61
|
+
detectionStrategy: 'combined',
|
|
62
|
+
difficulty: 'easy',
|
|
63
|
+
isCustom: true
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
this.configService.setCustomPose({
|
|
67
|
+
imageData: SAMPLE_POSE_IMAGE_DATA,
|
|
68
|
+
description: customPose.description
|
|
69
|
+
});
|
|
70
|
+
this.poseSelectionService.selectPoseByObject(customPose);
|
|
71
|
+
this.configService.updateConfig({
|
|
72
|
+
backends: ['mock'],
|
|
73
|
+
showIntroScreen: false,
|
|
74
|
+
enableVideoRecording: true,
|
|
75
|
+
autoCapture: true,
|
|
76
|
+
captureFrameCount: 5
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const modal = await this.modalCtrl.create({
|
|
80
|
+
component: VerificationModalComponent,
|
|
81
|
+
componentProps: { poseSpecific: true },
|
|
82
|
+
cssClass: 'verification-modal'
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
await modal.present();
|
|
86
|
+
const { data } = await modal.onDidDismiss();
|
|
87
|
+
if (data) {
|
|
88
|
+
this.lastResult = data;
|
|
89
|
+
console.log('[Showcase] Pose-specific modal result:', data);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
package/projects/facecog-liveness-verification-test/src/app/home/verification-modal.component.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { IonicModule, ModalController } from '@ionic/angular';
|
|
4
|
+
import {
|
|
5
|
+
LivenessFlowComponent,
|
|
6
|
+
LivenessConfigService,
|
|
7
|
+
LivenessResult,
|
|
8
|
+
PoseSelectionService
|
|
9
|
+
} from '@naniteninja/liveness-verification';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-verification-modal',
|
|
13
|
+
standalone: true,
|
|
14
|
+
imports: [CommonModule, IonicModule, LivenessFlowComponent],
|
|
15
|
+
template: `
|
|
16
|
+
<div class="modal-wrapper">
|
|
17
|
+
<div class="modal-header">
|
|
18
|
+
<h2>Liveness Check</h2>
|
|
19
|
+
<button (click)="dismiss()">
|
|
20
|
+
<ion-icon name="close"></ion-icon>
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="modal-body">
|
|
24
|
+
<facecog-liveness-flow
|
|
25
|
+
(verificationComplete)="onVerificationComplete($event)">
|
|
26
|
+
</facecog-liveness-flow>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
`,
|
|
30
|
+
styles: [`
|
|
31
|
+
:host {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
height: 100%;
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.modal-wrapper {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
height: 100%;
|
|
42
|
+
width: 100%;
|
|
43
|
+
background: var(--ion-background-color, #fff);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.modal-header {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
padding: 12px 16px;
|
|
51
|
+
background: var(--ion-color-primary);
|
|
52
|
+
color: #fff;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
min-height: 48px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.modal-header h2 {
|
|
58
|
+
margin: 0;
|
|
59
|
+
font-size: 18px;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.modal-header button {
|
|
64
|
+
background: none;
|
|
65
|
+
border: none;
|
|
66
|
+
color: #fff;
|
|
67
|
+
font-size: 24px;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
padding: 4px;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.modal-body {
|
|
76
|
+
flex: 1;
|
|
77
|
+
min-height: 0;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
}
|
|
82
|
+
`]
|
|
83
|
+
})
|
|
84
|
+
export class VerificationModalComponent implements OnInit {
|
|
85
|
+
@Input() poseSpecific = false;
|
|
86
|
+
@ViewChild(LivenessFlowComponent) livenessFlow!: LivenessFlowComponent;
|
|
87
|
+
|
|
88
|
+
constructor(
|
|
89
|
+
private modalCtrl: ModalController,
|
|
90
|
+
private configService: LivenessConfigService,
|
|
91
|
+
private poseSelectionService: PoseSelectionService
|
|
92
|
+
) {}
|
|
93
|
+
|
|
94
|
+
ngOnInit(): void {
|
|
95
|
+
console.log('[VerificationModal] Opened, poseSpecific:', this.poseSpecific);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
onVerificationComplete(result: any): void {
|
|
99
|
+
console.log('[VerificationModal] Verification complete:', result);
|
|
100
|
+
this.modalCtrl.dismiss(result as LivenessResult);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
dismiss(): void {
|
|
104
|
+
this.modalCtrl.dismiss(null);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Medium_0.ttf
ADDED
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Regular_0.ttf
ADDED
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-SemiBold_0.ttf
ADDED
|
Binary file
|
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/Five_Fingers_Left.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/Peace_Sign_Left.jpg
ADDED
|
Binary file
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Pose Reference Images
|
|
2
|
+
|
|
3
|
+
This directory contains reference images for all 40 pose options.
|
|
4
|
+
|
|
5
|
+
## Image Specifications
|
|
6
|
+
- **Format:** PNG with transparency
|
|
7
|
+
- **Size:** 200x200px (optimized for grid display)
|
|
8
|
+
- **Style:** Simple, clear illustration showing the pose
|
|
9
|
+
- **Background:** Transparent or white
|
|
10
|
+
|
|
11
|
+
## Pose Categories
|
|
12
|
+
|
|
13
|
+
### Face Expressions & Movements (1-6)
|
|
14
|
+
- 01-face-straight.png - Face straight, hold still
|
|
15
|
+
- 02-blink-once.png - Blink once, naturally
|
|
16
|
+
- 03-blink-twice.png - Blink twice, quickly
|
|
17
|
+
- 04-open-mouth.png - Open mouth, then close
|
|
18
|
+
- 05-smile.png - Smile, then return to neutral
|
|
19
|
+
- 06-raise-eyebrows.png - Raise eyebrows ("surprised" look)
|
|
20
|
+
|
|
21
|
+
### Head Movements (7-14)
|
|
22
|
+
- 07-turn-left.png - Turn head slowly left (profile)
|
|
23
|
+
- 08-turn-right.png - Turn head slowly right (profile)
|
|
24
|
+
- 09-look-up.png - Look up with just your eyes
|
|
25
|
+
- 10-look-down.png - Look down with just your eyes
|
|
26
|
+
- 11-tilt-left.png - Tilt head slightly left (ear to shoulder)
|
|
27
|
+
- 12-tilt-right.png - Tilt head slightly right (ear to shoulder)
|
|
28
|
+
- 13-nod.png - Nod up and down once or twice
|
|
29
|
+
- 14-shake-head.png - Shake head left to right once or twice
|
|
30
|
+
|
|
31
|
+
### Eye & Face Tracking (15-20)
|
|
32
|
+
- 15-follow-dot.png - Follow a moving dot/marker with your eyes
|
|
33
|
+
- 16-wink.png - Hold a wink (close one eye)
|
|
34
|
+
- 17-move-closer.png - Move your face closer, then back to center
|
|
35
|
+
- 18-speak-phrase.png - Speak a short random phrase (audio+video)
|
|
36
|
+
- 19-rotate-face.png - Slowly rotate face under normal light (passive liveness)
|
|
37
|
+
- 20-center-face.png - Keep face centered while the phone moves slightly (parallax)
|
|
38
|
+
|
|
39
|
+
### Basic Hand Gestures (21-29)
|
|
40
|
+
- 21-right-palm.png - Show right hand, palm to camera
|
|
41
|
+
- 22-left-palm.png - Show left hand, palm to camera
|
|
42
|
+
- 23-wave-right.png - Wave your right hand slowly
|
|
43
|
+
- 24-thumbs-up-right.png - Thumbs-up with right hand
|
|
44
|
+
- 25-thumbs-up-left.png - Thumbs-up with left hand
|
|
45
|
+
- 26-ok-sign-right.png - "OK" sign with right hand
|
|
46
|
+
- 27-peace-sign-left.png - "V/peace" sign with left hand
|
|
47
|
+
- 28-three-fingers-right.png - Hold up three fingers (right hand)
|
|
48
|
+
- 29-five-fingers-left.png - Hold up five fingers (left hand)
|
|
49
|
+
|
|
50
|
+
### Face + Hand Combined Poses (30-40)
|
|
51
|
+
- 30-touch-nose-right.png - Touch your nose with right index finger
|
|
52
|
+
- 31-touch-chin-left.png - Touch your chin with left index finger
|
|
53
|
+
- 32-touch-right-cheek.png - Touch your right cheek with right palm
|
|
54
|
+
- 33-touch-left-cheek.png - Touch your left cheek with left palm
|
|
55
|
+
- 34-cover-right-eye.png - Cover right eye with right hand, then uncover
|
|
56
|
+
- 35-cover-mouth.png - Cover your mouth with one hand, then uncover
|
|
57
|
+
- 36-frame-face.png - Frame your face with both hands (sides of face)
|
|
58
|
+
- 37-hand-ear-shoulder.png - Move right hand from ear level to shoulder level
|
|
59
|
+
- 38-cross-arms.png - Cross arms briefly, then return hands down
|
|
60
|
+
- 39-clap-once.png - Clap once softly in view
|
|
61
|
+
- 40-point-left-right.png - Point to left edge, then right edge of screen with index finger
|
|
62
|
+
|
|
63
|
+
## Creating Images
|
|
64
|
+
|
|
65
|
+
You can create these images using:
|
|
66
|
+
1. **Design Tools:** Figma, Adobe Illustrator, or Sketch
|
|
67
|
+
2. **Stock Icons:** Flaticon, Noun Project, or custom illustration
|
|
68
|
+
3. **AI Generation:** Use DALL-E, Midjourney, or Stable Diffusion
|
|
69
|
+
4. **Photography:** Take actual photos demonstrating each pose
|
|
70
|
+
|
|
71
|
+
### Recommended Approach
|
|
72
|
+
For production, use simple line-art illustrations or icon-style graphics that clearly show:
|
|
73
|
+
- The pose position
|
|
74
|
+
- Direction of movement (if applicable)
|
|
75
|
+
- Key body parts involved
|
|
76
|
+
|
|
77
|
+
For now, the application will gracefully handle missing images with a fallback icon display.
|
|
Binary file
|
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/Three_Fingers_Right.jpg
ADDED
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Left.jpg
ADDED
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Right.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_right_eye.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_chin_left.jpg
ADDED
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_left_cheek.jpeg
ADDED
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_nose_right.png
ADDED
|
Binary file
|
package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_right_cheek.jpeg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="350" height="140" xmlns="http://www.w3.org/2000/svg" style="background:#f6f7f9"><g fill="none" fill-rule="evenodd"><path fill="#F04141" style="mix-blend-mode:multiply" d="M61.905-34.23l96.194 54.51-66.982 54.512L22 34.887z"/><circle fill="#10DC60" style="mix-blend-mode:multiply" cx="155.5" cy="135.5" r="57.5"/><path fill="#3880FF" style="mix-blend-mode:multiply" d="M208.538 9.513l84.417 15.392L223.93 93.93z"/><path fill="#FFCE00" style="mix-blend-mode:multiply" d="M268.625 106.557l46.332-26.75 46.332 26.75v53.5l-46.332 26.75-46.332-26.75z"/><circle fill="#7044FF" style="mix-blend-mode:multiply" cx="299.5" cy="9.5" r="38.5"/><rect fill="#11D3EA" style="mix-blend-mode:multiply" transform="rotate(-60 148.47 37.886)" x="143.372" y="-7.056" width="10.196" height="89.884" rx="5.098"/><path d="M-25.389 74.253l84.86 8.107c5.498.525 9.53 5.407 9.004 10.905a10 10 0 0 1-.057.477l-12.36 85.671a10.002 10.002 0 0 1-11.634 8.42l-86.351-15.226c-5.44-.959-9.07-6.145-8.112-11.584l13.851-78.551a10 10 0 0 1 10.799-8.219z" fill="#7044FF" style="mix-blend-mode:multiply"/><circle fill="#0CD1E8" style="mix-blend-mode:multiply" cx="273.5" cy="106.5" r="20.5"/></g></svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file can be replaced during build by using the `fileReplacements` array.
|
|
2
|
+
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
|
|
3
|
+
// The list of file replacements can be found in `angular.json`.
|
|
4
|
+
|
|
5
|
+
export const environment = {
|
|
6
|
+
production: false,
|
|
7
|
+
apiUrl: 'https://api.test.thecyrano.app/api/server-3'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* For easier debugging in development mode, you can import the following file
|
|
12
|
+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
|
13
|
+
*
|
|
14
|
+
* This import should be commented out in production mode because it will have a negative impact
|
|
15
|
+
* on performance if an error is thrown.
|
|
16
|
+
*/
|
|
17
|
+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|