Browse Source

FilmPredictor: Fixed prediction error

master
Starbeamrainbowlabs 4 months ago
parent
commit
c9e7826416
Signed by: sbrl GPG Key ID: 1BE5172E637709C2
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/lib/FilmPredictor.mjs

+ 1
- 2
src/lib/FilmPredictor.mjs View File

@@ -131,7 +131,7 @@ class FilmPredictor {
);
return image.reshape([1, ...image.shape ]);
})
let result_array = await this.model.predict(imagetensor).array();
let result_array = (await this.model.predict(imagetensor).array())[0];
return this.array2genres(result_array);
}
@@ -140,7 +140,6 @@ class FilmPredictor {
for(let i = 0; i < arr.length; i++) {
if(arr[i] < 0.5)
continue;
result.push(genres[i]);
}
return result;


Loading…
Cancel
Save