From d0d0aba8fa03ae60322b5c099adb81a8b05d99ec Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 14 Aug 2021 13:39:26 -0400 Subject: [PATCH] add experimental webgu demo --- CHANGELOG.md | 4 +--- src/interpolate.ts | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b62fbeb..75779336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,7 @@ Repository: **** ### **HEAD -> main** 2021/08/14 mandic00@live.com - -### **origin/main** 2021/08/13 mandic00@live.com - +- complete async work - list detect cameras - switch to async data reads diff --git a/src/interpolate.ts b/src/interpolate.ts index 042f586b..19773d8d 100644 --- a/src/interpolate.ts +++ b/src/interpolate.ts @@ -7,6 +7,7 @@ import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result'; const bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 }; export function calc(newResult: Result): Result { + if (!newResult) return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 }; // each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself // otherwise bufferedResult is a shallow clone of result plus updated local calculated values // thus mixing by-reference and by-value assignments to minimize memory operations