doctorfree / MusicPlayerPlus

Featureful ncurses based MPD client inspired by ncmpc with integration for Beets, spectrum visualization,Bandcamp/Soundcloud, asciimatics, cantata, and more
https://musicplayerplus.dev
MIT License
77 stars 1 forks source link

[BUG] essentia svm issue #10

Closed JOJ0 closed 2 years ago

JOJ0 commented 2 years ago

Hi, since I had problems compiling Essentia extractors myself, and also due to a deprecation issue with ffmpeg5 (on Arch?) (https://github.com/MTG/essentia/issues/1248), I remembered your project and thought of an easy way out and "steal" your precompiled versions :-) I hope that's ok with you and I want to thank you so much for providing them. While still not being able to solve my problem I just went over to your repo to look if someone else is facing the same issue and came across https://github.com/doctorfree/MusicPlayerPlus/issues/9. Once again I'd like to thank you andm say how much I appreciate your efforts and plan of splitting the package!!! Awesome! Besides that I now have musicplayerplus installed on my arch linux laptop and thus will give it a try and hope it goes along with my already existing beets installation.

I'm still not sure if this is the right place to ask for help but I'll try anyway since I'm running out of ideas and you seem to have quiite some experience with using essentia.

I'm using the extractors with the beets xtractor plugin. This is what I get:

 dev  (beets)    ~/git/beets   all_in ●  beet -v xtractor randomer percussion 1           
user configuration: /home/jojo/.config/beets/config.yaml
data directory: /home/jojo/.config/beets
plugin paths: 
Sending event: pluginload
library database: /home/jojo/.config/beets/library.db
library directory: /home/jojo/Sync/beets_test_music
Sending event: library_opened
xtractor: Combined query: AndQuery([AnyFieldQuery('randomer', ('artist', 'title', 'comments', 'album', 'albumartist', 'genre'), SubstringQuery), AnyFieldQuery('percussion', ('artist', 'title', 'comments', 'album', 'albumartist', 'genre'), SubstringQuery), AnyFieldQuery('1', ('artist', 'title', 'comments', 'album', 'albumartist', 'genre'), SubstringQuery)])
xtractor: Number of items to be processed: 1
xtractor: Running analysis for: /home/jojo/Sync/beets_test_music/Randomer - Stupid Things I Do [CBS016] [2014] mp3tag/03 - Randomer - Percussion Workout 1.mp3
xtractor: Extractor: /usr/bin/essentia_streaming_extractor_music
xtractor: Input: /home/jojo/Sync/beets_test_music/Randomer - Stupid Things I Do [CBS016] [2014] mp3tag/03 - Randomer - Percussion Workout 1.mp3
xtractor: Output: /tmp/27c28b8f-7a5f-4c5c-9b7e-9f827c575866.json
xtractor: Profile: /tmp/profile.yml
xtractor: Executing: "/usr/bin/essentia_streaming_extractor_music" "/home/jojo/Sync/beets_test_music/Randomer - Stupid Things I Do [CBS016] [2014] mp3tag/03 - Randomer - Percussion Workout 1.mp3" "/tmp/27c28b8f-7a5f-4c5c-9b7e-9f827c575866.json" "/tmp/profile.yml"
xtractor: The process exited with code: 1
xtractor: Process stdout: 
xtractor: Process stderr: [   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_sad.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/danceability.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/gender.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_dortmund.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_electronic.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_rosamerica.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_tzanetakis.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_acoustic.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_aggressive.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_electronic.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_happy.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_party.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_relaxed.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_sad.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/moods_mirex.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/timbre.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/tonal_atonal.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/voice_instrumental.history
[   INFO   ] MusicExtractor: Read metadata
[   INFO   ] MusicExtractor: Compute md5 audio hash, codec, length, and EBU 128 loudness
[   INFO   ] MusicExtractor: Replay gain
[   INFO   ] MusicExtractor: Compute audio features
[   INFO   ] MusicExtractor: Compute aggregation
[   INFO   ] MusicExtractor: SVM models
Pool: Cannot add/set/merge value to the pool under the name 'highlevel.mood_sad' because 'highlevel.mood_sad' has child descriptor names (e.g. 'highlevel.mood_sad.all.not_sad')

xtractor: File not found: Output file(/tmp/27c28b8f-7a5f-4c5c-9b7e-9f827c575866.json) not found!
Excluding tags from write: 
Sending event: write
Sending event: after_write
Sending event: cli_exit
 dev  (beets)    ~/git/beets   all_in ●  
JOJ0 commented 2 years ago

Here's my config:

xtractor:
    auto: no
    dry-run: no
    write: yes
    threads: 1
    force: yes
    quiet: no
    keep_output: yes
    keep_profiles: yes
    output_path: /tmp
    essentia_extractor: /usr/bin/essentia_streaming_extractor_music
    extractor_profile:
        highlevel:
            compute: 1
            svm_models:
            - /usr/share/musicplayerplus/svm_models/mood_sad.history
            - /usr/share/musicplayerplus/svm_models/danceability.history
            - /usr/share/musicplayerplus/svm_models/gender.history
            - /usr/share/musicplayerplus/svm_models/genre_dortmund.history
            - /usr/share/musicplayerplus/svm_models/genre_electronic.history
            - /usr/share/musicplayerplus/svm_models/genre_rosamerica.history
            - /usr/share/musicplayerplus/svm_models/genre_tzanetakis.history
            - /usr/share/musicplayerplus/svm_models/mood_acoustic.history
            - /usr/share/musicplayerplus/svm_models/mood_aggressive.history
            - /usr/share/musicplayerplus/svm_models/mood_electronic.history
            - /usr/share/musicplayerplus/svm_models/mood_happy.history
            - /usr/share/musicplayerplus/svm_models/mood_party.history
            - /usr/share/musicplayerplus/svm_models/mood_relaxed.history
            - /usr/share/musicplayerplus/svm_models/mood_sad.history
            - /usr/share/musicplayerplus/svm_models/moods_mirex.history
            - /usr/share/musicplayerplus/svm_models/timbre.history
            - /usr/share/musicplayerplus/svm_models/tonal_atonal.history
            - /usr/share/musicplayerplus/svm_models/voice_instrumental.history
        outputFormat: json
        outputFrames: 0
        lowlevel:
            frameSize: 2048
            hopSize: 1024
        chromaprint:
            compute: 0
    low_level_targets:
        bpm:
            path: rhythm.bpm
            type: integer
            required: yes
        danceability:
            path: rhythm.danceability
            type: float
        beats_count:
            path: rhythm.beats_count
            type: integer
        average_loudness:
            path: lowlevel.average_loudness
            type: float
            required: yes
    high_level_targets:
        danceable:
            path: highlevel.danceability.all.danceable
            type: float
            required: yes
        gender:
            path: highlevel.gender.value
            type: string
            required: yes
        is_male:
            path: highlevel.gender.all.male
            type: float
        is_female:
            path: highlevel.gender.all.female
            type: float
        genre_rosamerica:
            path: highlevel.genre_rosamerica
            type: string
            required: yes
        voice_instrumental:
            path: highlevel.voice_instrumental.value
            type: string
            required: yes
        is_voice:
            path: highlevel.voice_instrumental.all.voice
            type: float
        is_instrumental:
            path: highlevel.voice_instrumental.all.instrumental
            type: float
        mood_acoustic:
            path: highlevel.mood_acoustic.all.acoustic
            type: float
            required: yes
        mood_aggressive:
            path: highlevel.mood_aggressive.all.aggressive
            type: float
            required: yes
        mood_electronic:
            path: highlevel.mood_electronic.all.electronic
            type: float
            required: yes
        mood_happy:
            path: highlevel.mood_happy.all.happy
            type: float
            required: yes
        mood_sad:
            path: highlevel.mood_sad.all.sad
            type: float
            required: yes
        mood_party:
            path: highlevel.mood_party.all.party
            type: float
            required: yes
        mood_relaxed:
            path: highlevel.mood_relaxed.all.relaxed
            type: float
            required: yes
        mood_mirex:
            path: highlevel.moods_mirex.value
            type: string
            required: yes
        mood_mirex_cluster_1:
            path: highlevel.moods_mirex.all.Cluster1
            type: float
        mood_mirex_cluster_2:
            path: highlevel.moods_mirex.all.Cluster2
            type: float
        mood_mirex_cluster_3:
            path: highlevel.moods_mirex.all.Cluster3
            type: float
        mood_mirex_cluster_4:
            path: highlevel.moods_mirex.all.Cluster4
            type: float
        mood_mirex_cluster_5:
            path: highlevel.moods_mirex.all.Cluster5
            type: float
JOJ0 commented 2 years ago

And here is another testrun. Keeping beets aside and just executing the command the xtractor plugins "Executing: ...." debug log statement gives me:

 dev  (beets)    ~/git/beets   all_in ●  "/usr/bin/essentia_streaming_extractor_music" "/home/jojo/Sync/beets_test_music/Randomer - Stupid Things I Do [CBS016] [2014] mp3tag/03 - Randomer - Percussion Workout 1.mp3" "/tmp/27c28b8f-7a5f-4c5c-9b7e-9f827c575866.json" "/tmp/profile.yml"
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_sad.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/danceability.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/gender.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_dortmund.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_electronic.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_rosamerica.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/genre_tzanetakis.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_acoustic.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_aggressive.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_electronic.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_happy.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_party.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_relaxed.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/mood_sad.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/moods_mirex.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/timbre.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/tonal_atonal.history
[   INFO   ] MusicExtractorSVM: adding SVM model /usr/share/musicplayerplus/svm_models/voice_instrumental.history
[   INFO   ] MusicExtractor: Read metadata
[   INFO   ] MusicExtractor: Compute md5 audio hash, codec, length, and EBU 128 loudness
[   INFO   ] MusicExtractor: Replay gain
[   INFO   ] MusicExtractor: Compute audio features
[   INFO   ] MusicExtractor: Compute aggregation
[   INFO   ] MusicExtractor: SVM models
Pool: Cannot add/set/merge value to the pool under the name 'highlevel.mood_sad' because 'highlevel.mood_sad' has child descriptor names (e.g. 'highlevel.mood_sad.all.not_sad')

xtractor's keep_profile option let's me reuse the essentia profile which is this:

   dev  (beets)    ~/git/beets   all_in ●  cat /tmp/profile.yml 
chromaprint:
  compute: 0
highlevel:
  compute: 1
  svm_models:
  - /usr/share/musicplayerplus/svm_models/mood_sad.history
  - /usr/share/musicplayerplus/svm_models/danceability.history
  - /usr/share/musicplayerplus/svm_models/gender.history
  - /usr/share/musicplayerplus/svm_models/genre_dortmund.history
  - /usr/share/musicplayerplus/svm_models/genre_electronic.history
  - /usr/share/musicplayerplus/svm_models/genre_rosamerica.history
  - /usr/share/musicplayerplus/svm_models/genre_tzanetakis.history
  - /usr/share/musicplayerplus/svm_models/mood_acoustic.history
  - /usr/share/musicplayerplus/svm_models/mood_aggressive.history
  - /usr/share/musicplayerplus/svm_models/mood_electronic.history
  - /usr/share/musicplayerplus/svm_models/mood_happy.history
  - /usr/share/musicplayerplus/svm_models/mood_party.history
  - /usr/share/musicplayerplus/svm_models/mood_relaxed.history
  - /usr/share/musicplayerplus/svm_models/mood_sad.history
  - /usr/share/musicplayerplus/svm_models/moods_mirex.history
  - /usr/share/musicplayerplus/svm_models/timbre.history
  - /usr/share/musicplayerplus/svm_models/tonal_atonal.history
  - /usr/share/musicplayerplus/svm_models/voice_instrumental.history
lowlevel:
  frameSize: 2048
  hopSize: 1024
outputFormat: json
outputFrames: 0
 dev  (beets)    ~/git/beets   all_in ●  
JOJ0 commented 2 years ago

Oh, stupid me, I just realized what the problem is. I'm adding the svm model mood_sad twice:

  - /usr/share/musicplayerplus/svm_models/mood_sad.history

Ok so nevermind, but thanks anyway for the precompiled extractors and I might come back with other questions around mpplusm now that I have it installed I might even play around with it. Great project I think but havent had the time to try if it fits my needs.

doctorfree commented 2 years ago

Glad you figured it out and yes, please come back with any questions you might have or problems you run into or suggestions for improvements to MusicPlayerPlus. I think I will open a Github Discussions for this project so we can discuss separately from issues.