@privateid/charlie-web-sdk-alpha
Advanced tools
Comparing version 0.0.2-alpha to 0.0.3-alpha
@@ -49,7 +49,2 @@ import { CameraFaceMode } from './types'; | ||
export declare function enroll({ callback, config, element, returnPortrait }: enrollProps): Promise<ImageData | { | ||
result: number; | ||
imageData: Uint8ClampedArray; | ||
height: number; | ||
width: number; | ||
} | { | ||
result: string; | ||
@@ -123,2 +118,3 @@ }>; | ||
}>; | ||
export declare const checkIfModelsAreLoaded: () => void; | ||
export {}; |
@@ -572,3 +572,6 @@ /* eslint-disable no-loop-func */ | ||
console.log("Before worker enroll"); | ||
const bestImage = yield ultraEnroll(imageData, isSimd, JSON.stringify(configJSON), proxy(privid_wasm_result)); | ||
console.log({ | ||
imageData, isSimd, config: JSON.stringify(configJSON), cb: proxy(privid_wasm_result) | ||
}); | ||
yield ultraEnroll(imageData, isSimd, JSON.stringify(configJSON), proxy(privid_wasm_result)); | ||
if (isDebugWithImages) { | ||
@@ -581,3 +584,2 @@ yield createImages([imageData], ImageType.original, true); | ||
} | ||
return bestImage; | ||
}); | ||
@@ -869,2 +871,4 @@ } | ||
}); | ||
export const checkIfModelsAreLoaded = () => { | ||
}; | ||
//# sourceMappingURL=faceModule.js.map |
@@ -90,3 +90,3 @@ export type Base64 = ArrayBuffer | string; | ||
}>; | ||
compareEmbeddings: () => Promise<{ | ||
ultraCompareEmbeddings: () => Promise<{ | ||
result: number; | ||
@@ -110,3 +110,3 @@ imageData: Uint8ClampedArray | null; | ||
}>; | ||
checkIfModelsLoadedultraScanBackDocument: (isEnroll: boolean) => Promise<number>; | ||
checkIfModelsLoaded: (isEnroll: boolean) => Promise<number>; | ||
}; | ||
@@ -113,0 +113,0 @@ export interface verificationSessionPayload { |
@@ -10,3 +10,3 @@ import { Base64, ImageType, LOGTYPE, ScreenOrientation } from './types'; | ||
href: ImageData[]; | ||
}>, compareEmbeddings: () => Promise<{ | ||
}>, ultraCompareEmbeddings: () => Promise<{ | ||
result: number; | ||
@@ -26,3 +26,3 @@ imageData: Uint8ClampedArray; | ||
[x: string]: any; | ||
}>; | ||
}>, checkIfModelsLoaded: (isEnroll: boolean) => Promise<number>; | ||
export declare function iOS(): boolean; | ||
@@ -29,0 +29,0 @@ export declare function isMobileFunc(): boolean; |
@@ -16,3 +16,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const functions = wrap(new Worker('./workers/wasm.worker.js')); | ||
export const { isLoad, ultraEnroll, ultraPredict, compareEmbeddings, pkiEncrypt, ultraScanBackDocument, ultraScanFrontDocument, } = functions; | ||
export const { isLoad, ultraEnroll, ultraPredict, ultraCompareEmbeddings, pkiEncrypt, ultraScanBackDocument, ultraScanFrontDocument, checkIfModelsLoaded, } = functions; | ||
export function iOS() { | ||
@@ -27,3 +27,3 @@ return ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform); | ||
check = true; | ||
})(navigator.userAgent || navigator.vendor || window.opera); | ||
})(navigator.userAgent || navigator.vendor); | ||
return check; | ||
@@ -30,0 +30,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "CryptoNets WebAssembly SDK", | ||
"version": "0.0.2-alpha", | ||
"version": "0.0.3-alpha", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "Face recognition", |
@@ -6,3 +6,2 @@ /* eslint-disable no-eval */ | ||
// importScripts('https://unpkg.com/comlink/dist/umd/comlink.js'); | ||
importScripts('./comlink.min.js'); | ||
@@ -150,2 +149,8 @@ | ||
const ultraEnroll = async (imageData, simd, config, cb) => { | ||
console.log({ | ||
imageData, | ||
simd, | ||
config, | ||
cb, | ||
}); | ||
console.log('Ultra Enroll starting'); | ||
@@ -185,16 +190,2 @@ privid_wasm_result = cb; | ||
// let bestImage = null; | ||
// const [outputBufferSize] = new Uint32Array(wasmPrivModules.HEAPU8.buffer, bestImageLenPtr, 1); | ||
// if (outputBufferSize > 0) { | ||
// let outputBufferSecPtr = null; | ||
// [outputBufferSecPtr] = new Uint32Array(wasmPrivModules.HEAPU8.buffer, bestImageFirstPtr, 1); | ||
// const outputBufferPtr = new Uint8Array(wasmPrivModules.HEAPU8.buffer, outputBufferSecPtr, outputBufferSize); | ||
// const outputBuffer = Uint8ClampedArray.from(outputBufferPtr); | ||
// const outputBufferData = outputBufferSize > 0 ? outputBuffer : null; | ||
// bestImage = { imageData: outputBufferData, width: imageData.width, height: imageData.height }; | ||
// wasmPrivModules._free(outputBufferPtr); | ||
// } | ||
wasmPrivModules._free(imageInputPtr); | ||
@@ -206,3 +197,2 @@ wasmPrivModules._free(resultFirstPtr); | ||
wasmPrivModules._free(bestImageLenPtr); | ||
// return bestImage; | ||
}; | ||
@@ -209,0 +199,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35768641
5397