Music Demixing Challenge ISMIR 2021
🚀 Make your submissions from inside Google Colab
Explore different baselines and make your submission
Dear participants,
Check out the Colab notebook below, and get started with the challenge easily, right from inside Google Colab!
Let us know if you face any issues or want to share any feedback.

How to use this notebook 📝¶
- Copy the notebook. This is a shared template and any edits you make here will not be saved. You should copy it into your own drive folder. For this, click the "File" menu (top-left), then "Save a Copy in Drive". You can edit your copy however you like.
- Link it to your AIcrowd account. In order to submit your code to AIcrowd, you need to add ssh key to your GitLab account temporarily.
- Stick to the classes definitions. The submission to AIcrowd will look for the pre-defined class names.
Setup the notebook 🛠¶
In [ ]:
!pip install -q -U "tqdm<4.60"
!apt install git-lfs
!git clone https://github.com/AIcrowd/music-demixing-challenge-starter-kit.git > /dev/null
%cd music-demixing-challenge-starter-kit
!git lfs pull
👇 Run the below collapsed cell for helper functions¶
In [ ]:
#@title
import os
import IPython
import pprint
def display_result(path):
print(path)
print("🔈 Bass:")
display(IPython.display.Audio(path + "/bass.wav"))
print("🥁 Drums:")
display(IPython.display.Audio(path + "/drums.wav"))
print("🎹 Other:")
display(IPython.display.Audio(path + "/other.wav"))
print("🎤 Vocals:")
display(IPython.display.Audio(path + "/vocals.wav"))
def install_pip_and_apt_on_colab():
default_requirements = open("requirements.txt").read().split('\n')
local_pip_install = " ".join(default_requirements + PIP_PACKAGES)
default_packages = open("apt.txt").read().split('\n')
local_apt_install = " ".join(default_packages + APT_PACKAGES)
!pip install -q $local_pip_install
!apt install -y {local_apt_install}
def write_custom_implementation(file_name):
relevant_cell = None
for i in _ih[::-1]:
if "bfb41056a0e55e7b715c21ea9285cb1c" in i and "relevant_cell" not in i:
relevant_cell = i
if relevant_cell is None:
raise Exception("Did you run your custom code?")
with open(file_name, "w") as f:
f.write(relevant_cell)
def add_models_to_submission(model_regex):
import os
echo_and_run("git lfs install")
echo_and_run("git lfs track \"%s\"" % model_regex)
echo_and_run("git add .gitattributes")
def echo_and_run(command):
print("#> " + command)
return os.system(command)
def make_submission():
status_code = echo_and_run("ssh -o StrictHostKeyChecking=no -T git@gitlab.aicrowd.com")
if status_code > 1:
raise Exception("SSH login failed, did you add above SSH key in your account?")
!git push aicrowd master -f
!git push aicrowd --tags
def prepare_for_submission(class_name, commit_message=None):
import datetime
import time
timestamp_now = int(time.time())
time_now = datetime.datetime.utcnow().strftime('%B %d %Y - %H:%M:%S')
file_name = os.popen("grep -nr \"class %s\" *.py" % class_name).read().split(':')[0].split('.')[0]
predict_py_content = """#!/usr/bin/env python
from {file_name} import {class_name}
submission = {class_name}()
submission.run()
print("Successfully completed music demixing...")
""".format(class_name=class_name, file_name=file_name)
with open("predict.py", "w") as f:
f.write(predict_py_content)
echo_and_run("git add .")
if not commit_message:
commit_message = "Automated submission via notebook: %s" % time_now
if not AICROWD_USER_NAME or not AICROWD_EMAIL_ID:
raise Exception("AICROWD_USER_NAME or AICROWD_EMAIL_ID not configured")
echo_and_run("git config --global user.name \"%s\"" % AICROWD_USER_NAME)
echo_and_run("git config --global user.email \"%s\"" % AICROWD_EMAIL_ID)
echo_and_run("git commit -m \"%s\"" % commit_message)
echo_and_run("git remote add aicrowd git@gitlab.aicrowd.com:%s/music-demixing-challenge-starter-kit.git" % AICROWD_USER_NAME)
echo_and_run("git tag submission-v%s" % timestamp_now)
if not os.path.isfile("/root/.ssh/id_rsa.pub"):
echo_and_run('cat /dev/zero | ssh-keygen -q -N "" > /dev/null')
ssh_pub = open("/root/.ssh/id_rsa.pub").read()
return IPython.display.HTML("""
<h3>👉 Copy paste below ssh key to your profile:
<a href="https://gitlab.aicrowd.com/profile/keys" target="_blank">Add</a>
</h3>
<i>Please remove the SSH key from your profile after you make your submission.<i>
<br>
<textarea cols=100 rows=10>%s</textarea>""" % ssh_pub)
Configure your environment 📎¶
In [ ]:
# Additional **pip** packages required by your submission
# Default list: https://github.com/AIcrowd/music-demixing-challenge-starter-kit/blob/master/requirements.txt
PIP_PACKAGES = [
'musdb',
]
# Additional **apt** packages required by your submission.
# Default list: https://github.com/AIcrowd/music-demixing-challenge-starter-kit/blob/master/apt.txt
APT_PACKAGES = [
'ffmpeg',
]
install_pip_and_apt_on_colab()
Download dataset files 💾¶
In [ ]:
# You can select to download full dataset or 7s dataset, it will be present in `data/` folder.
# !python utility/verify_or_download_data.py
Baselines 🗃¶
Let's go through few of the baselines, before jumping to the problem!
🎶 Let's listen to example song added as part of starter kit.
In [ ]:
import IPython, os
print("Original mixture:")
IPython.display.Audio("data/test/Mu - Too Bright/mixture.wav")
Out[ ]: