Skip to content

Commit

Permalink
Musicnn: Only load the first 120s to avoid OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr committed Oct 24, 2021
1 parent 4a5be7a commit b29da0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/classifier_musicnn.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function findRule(className) {

if (process.argv.length < 3) throw new Error('Incorrect arguments: node classify.js ...<IMAGE_FILES> | node classify.js -')

/**
*
*/
async function main() {
const modelPath = path.resolve(__dirname, '..', 'music_model')

Expand Down
1 change: 1 addition & 0 deletions src/musicnn/MusicnnModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class MusicnnModel {
'-ac', '1',
'-ar', '8000',
'-acodec', 'pcm_s16le',
'-t', '120',
'-',
], { encoding: null, stripFinalNewline: false })

Expand Down

0 comments on commit b29da0a

Please sign in to comment.