mir-aidj / all-in-one

All-In-One Music Structure Analyzer
http://arxiv.org/abs/2307.16425
MIT License
406 stars 46 forks source link

Should demucs be run with -j num_cpus to speed it up? #1

Closed vpavlenko closed 1 year ago

vpavlenko commented 1 year ago

Thank you for the awesome library.

I wonder if running demucs in https://github.com/mir-aidj/all-in-one/blob/ea51ed313a573e93a3599fca55578aa9179b3a6f/src/allin1/demix.py#L32 may benefit from adding --jobs flag in case there's no GPU present? I run it in HuggingFace, and I get a two-fold boost on CPU UPGRADE (8 vCPUs compared to 2 vCPUs in the free Spaces)

(For the context of how I use it: I copy the link of the output archive from Hugging Face ("Compressed Files") and paste it into the edit field of https://music-dissector.vercel.app/)

tae-jun commented 1 year ago

Wow, thanks! I didn't know the option exists.

According to your experience and here, I guess it will increase the speed on CPUs.

Thank you so much for your contribution! I will include this PR in the next release.

tae-jun commented 1 year ago

And if you don't mind, may I ask your purpose of launching your own Music Dissector? :)

I'm just curious haha

vpavlenko commented 1 year ago

I'm dreaming about building a holistic tool that helps people see more in music. My previous attempt was to enhance classical midis with roman numerals: https://rawl.vercel.app/edit?a=beethoven_op10no1mov1

My current idea with Music Dissector is to do it even more all-in-one-y. Today I prototyped adding basic-pitch for tonal stems, I hope to integrate some automated chord information soon.

I don't have any commercial interest (since music is all about copyright anyways), my purpose is more exploratory and pedagogic. I'm also not affiliated with any research institure right now, mostly I'm just running a local music theory course at a hacker space for music enthusiasts.

The only other tools with similar UX that I know is RipX, but it's not free, it's not very up-to-date and it's not in the browser. So I think the world may benefit in having one. So far I found these tools to integrate: https://github.com/vpavlenko/study-music/blob/main/parts/transcription.md

If you know any other tools or have any suggestions or concerns, I'm very happy to hear.

Screenshot 2023-09-07 at 21 55 37
vpavlenko commented 1 year ago

Yesterday I used it in my lecture to faster navigate through the tracks I was analysing: https://youtu.be/s2qr8kNq47s?si=wrvcXAx4bQHbSSlP&t=682

tae-jun commented 1 year ago

🤯 That's brilliant! I guess it can process the audio on the fly by the given URL and transcribe it as well.

I'm happy that someone can utilize the demo code! It's quite complicated so I thought it would be difficult to be reused.

If you give any feedback about using allin1, it would be appreciated and I will actively incorporate it!