minor refactor

This commit is contained in:
Rushikesh Tote 2022-05-30 09:29:18 +05:30
parent af5f1dabbc
commit a4a12d1382

View file

@ -20,9 +20,10 @@ class SceneDetectionService {
async run(file: File) {
const bmp = await createImageBitmap(file);
tf.ready().then(async () => {
const currTime = new Date().getTime();
await tf.ready();
const currTime = new Date().getTime();
const output = tf.tidy(() => {
let tensor = tf.browser.fromPixels(bmp);
@ -42,7 +43,6 @@ class SceneDetectionService {
const data = await (output as tf.Tensor).data();
const scenes = this.getScenes(data as Float32Array);
console.log('scenes', scenes);
});
}
getScenes(outputData: Float32Array) {