@hexar/biometric-identity-sdk-core 1.5.0 → 1.6.0

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.
@@ -254,8 +254,12 @@ class BiometricIdentitySDK {
254
254
  let videoFrames = params.videoFrames;
255
255
  const MAX_FRAMES = 15;
256
256
  if (videoFrames.length > MAX_FRAMES) {
257
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
258
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
257
+ const sampled = [];
258
+ for (let i = 0; i < MAX_FRAMES; i++) {
259
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
260
+ sampled.push(videoFrames[idx]);
261
+ }
262
+ videoFrames = sampled;
259
263
  logger_1.logger.info('Sampled frames for profile picture validation', {
260
264
  originalCount: params.videoFrames.length,
261
265
  sampledCount: videoFrames.length
@@ -385,8 +389,12 @@ class BiometricIdentitySDK {
385
389
  // (150–300 ms) was statistically unlikely to be captured in any frame.
386
390
  const MAX_FRAMES = 15;
387
391
  if (videoFrames.length > MAX_FRAMES) {
388
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
389
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
392
+ const sampled = [];
393
+ for (let i = 0; i < MAX_FRAMES; i++) {
394
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
395
+ sampled.push(videoFrames[idx]);
396
+ }
397
+ videoFrames = sampled;
390
398
  logger_1.logger.info('Sampled frames for validation', {
391
399
  originalCount: this.state.videoData.frames.length,
392
400
  sampledCount: videoFrames.length
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexar/biometric-identity-sdk-core",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Core AI engine for biometric identity verification",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -338,8 +338,12 @@ export class BiometricIdentitySDK {
338
338
  let videoFrames = params.videoFrames;
339
339
  const MAX_FRAMES = 15;
340
340
  if (videoFrames.length > MAX_FRAMES) {
341
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
342
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
341
+ const sampled: string[] = [];
342
+ for (let i = 0; i < MAX_FRAMES; i++) {
343
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
344
+ sampled.push(videoFrames[idx]);
345
+ }
346
+ videoFrames = sampled;
343
347
  logger.info('Sampled frames for profile picture validation', {
344
348
  originalCount: params.videoFrames.length,
345
349
  sampledCount: videoFrames.length
@@ -498,8 +502,12 @@ export class BiometricIdentitySDK {
498
502
  // (150–300 ms) was statistically unlikely to be captured in any frame.
499
503
  const MAX_FRAMES = 15;
500
504
  if (videoFrames.length > MAX_FRAMES) {
501
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
502
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
505
+ const sampled: string[] = [];
506
+ for (let i = 0; i < MAX_FRAMES; i++) {
507
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
508
+ sampled.push(videoFrames[idx]);
509
+ }
510
+ videoFrames = sampled;
503
511
  logger.info('Sampled frames for validation', {
504
512
  originalCount: this.state.videoData.frames.length,
505
513
  sampledCount: videoFrames.length