ditr-face-anit-spoofing-data-collection
v1.0.8
Published
just for testing only
Readme
Install via NPM
On the command line, navigate to the root directory of your project:
cd /path/to/projectRun the following command:
npm initAnswer the questions in the command line questionnaire.
Install ditr-face-anit-spoofing-data-collection:
npm i ditr-face-anit-spoofing-data-collectionFor example:
- index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Ditr Component</title>
<style>
.mainLayout {
max-width: max-content;
margin: auto;
}
.showComponent {
width: 500px;
height: 700px;
}
</style>
<script src="./node_modules/ditr-face-anit-spoofing-data-collection/ditr-face-anit-spoofing.bundle.js"></script>
<script src="./node_modules/ditr-face-anit-spoofing-data-collection/opencv.js"></script>
<script src="./node_modules/ditr-face-anit-spoofing-data-collection/conver_image.js"></script>
</head>
<body class="mainLayout">
<div class="showComponent">
<h2>Ditr Component</h2>
<ditr-face-anit-spoofing></ditr-face-anit-spoofing>
</div>
</body>
</html>- index.js
const ditrEkyc = document.getElementsByTagName("ditr-face-anit-spoofing")[0];
function ditrListener(result) {
console.log(JSON.stringify(result));
}
ditrEkyc.addEventListener("ditr-face-anit-spoofing", ditrListener);Noted
Accessing camera devices requires a secure browsing context. Broadly speaking, this means that you need to serve your web application over HTTPS (or localhost for local development). For insecure contexts CameraPlatform.availableCameras might throw a CameraException with the permissionDenied error code.
