Skip to content

Instantly share code, notes, and snippets.

View jakubdolejs's full-sized avatar

Jakub Dolejs jakubdolejs

View GitHub Profile
@jakubdolejs
jakubdolejs / VerIdCordova.js
Created March 21, 2018 19:26
Ver-ID Person Cordova plugin example use
var userId = "myUserId"; // String with an identifier for the user
// Registration
function register() {
var settings = new verid.RegistrationSessionSettings(userId);
settings.showGuide = true; // If you wish the plugin to guide the user through the registration process
settings.showResult = true; // If you wish the plugin to show the result of the session to the user
verid.register(settings, function(response) {
if (response.outcome == 0) {
@jakubdolejs
jakubdolejs / VerIdCordovaLiveness.js
Created March 21, 2018 19:30
Ver-ID Person Cordova plugin liveness detection
// Load Ver-ID before running liveness detection
verid.load(function(){
// Ver-ID loaded successfully
// Run a liveness detection session
var settings = verid.LivenessDetectionSessionSettings();
verid.captureLiveFace(settings, function(response) {
// Session finished
if (response.outcome == 0 && response.faces.length > 0) {
var faceTemplate = response.faces[0].template;
@jakubdolejs
jakubdolejs / response.js
Last active March 21, 2018 19:34
Ver-ID Person Cordova Plugin sample session response
{
"outcome": 0, // 0 = success
"faces": [
{
"x": 0.1, // The left coordinate of the face bounding box relative to the image width
"y": 0.3, // The top coordinate of the face bounding box relative to the image height
"width": 0.2, // The width of the face bounding box relative to the image width
"height": 0.5, // The height of the face bounding box relative to the image height
"template": "..." // Template used for face comparison (see below)
}
@jakubdolejs
jakubdolejs / faceComparison.js
Created March 21, 2018 19:35
Compare face templates using Ver-ID Person Cordova plugin
var score = veridutils.compareFaceTemplates(template1, template2);
@jakubdolejs
jakubdolejs / load.js
Last active March 21, 2018 19:37
Loading Ver-ID Person Cordova plugin
var apiSecret = "..."; // Alternative way to set your Ver-ID API secret
verid.load(apiSecret, function(){
// Ver-ID loaded successfully
// You can now run registration, authentication or liveness detection
}, function(){
// Ver-ID failed to load
});
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@jakubdolejs
jakubdolejs / Angle.java
Last active December 14, 2018 14:11
DetRecLib interface
public interface Angle {
float getYaw();
float getPitch();
float getRoll();
}
#import <UIKit/UIKit.h>
#import <VerIDUI/VerIDUI-Swift.h>
#import <VerIDCore/VerIDCore-Swift.h>
@interface CameraView : UIView<VerIDSessionDelegate, VerIDSessionViewDelegate>
@end