diff --git a/CHANGELOG.md b/CHANGELOG.md index 773f6ea4..d6baed5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,8 @@ ### **HEAD -> main** 2021/10/10 mandic00@live.com - -### **origin/main** 2021/10/08 mandic00@live.com - +- image processing fixes +- redesign body and hand caching and interpolation - demo default config cleanup - improve gaze and face angle visualizations in draw diff --git a/src/image/image.ts b/src/image/image.ts index a131968a..7e1be008 100644 --- a/src/image/image.ts +++ b/src/image/image.ts @@ -165,9 +165,9 @@ export function process(input: Input, config: Config, getTensor: boolean = true) pixels = tf.browser ? tf.browser.fromPixels(input) : null; } else { depth = input['data'].length / input['height'] / input['width']; - const arr = Uint8Array.from(input['data']); - // const arr = new Uint8Array(input['data']['buffer']); - pixels = tf.tensor(arr, [input['height'], input['width'], depth], 'float32'); + // const arr = Uint8Array.from(input['data']); + const arr = new Uint8Array(input['data']['buffer']); + pixels = tf.tensor(arr, [input['height'], input['width'], depth], 'int32'); } } else { if (!tmpCanvas || (outCanvas.width !== tmpCanvas.width) || (outCanvas?.height !== tmpCanvas?.height)) tmpCanvas = canvas(outCanvas.width, outCanvas.height); // init output canvas diff --git a/src/tfjs/backend.ts b/src/tfjs/backend.ts index 813f71b5..e725031a 100644 --- a/src/tfjs/backend.ts +++ b/src/tfjs/backend.ts @@ -91,7 +91,9 @@ export async function check(instance, force = false) { // customize webgpu if (tf.getBackend() === 'webgpu') { - tf.ENV.set('WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD', 256); + tf.ENV.set('WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD', 512); + tf.ENV.set('WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE', 0); + tf.ENV.set('WEBGPU_CPU_FORWARD', true); } // wait for ready