From 5f1eb7a3abc56ea120d17ebdc545013c63616f4a Mon Sep 17 00:00:00 2001 From: Ma5onic <18509613+Ma5onic@users.noreply.github.com> Date: Mon, 15 Aug 2022 01:28:54 -0400 Subject: [PATCH 1/3] Add Workaround For Windows Users --- evaluator/music_demixing.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/evaluator/music_demixing.py b/evaluator/music_demixing.py index 1ad121d..cb7f2a1 100644 --- a/evaluator/music_demixing.py +++ b/evaluator/music_demixing.py @@ -10,6 +10,7 @@ from contextlib import contextmanager from os import listdir from os.path import isfile, join +from sys import platform import soundfile as sf import numpy as np @@ -21,15 +22,18 @@ class TimeoutException(Exception): pass @contextmanager def time_limit(seconds): - def signal_handler(signum, frame): - raise TimeoutException("Prediction timed out!") - - signal.signal(signal.SIGALRM, signal_handler) - signal.alarm(seconds) - try: + if platform != "win32": + def signal_handler(signum, frame): + raise TimeoutException("Prediction timed out!") + + signal.signal(signal.SIGALRM, signal_handler) + signal.alarm(seconds) + try: + yield + finally: + signal.alarm(0) + else: yield - finally: - signal.alarm(0) class MusicDemixingPredictor: From f9eb61f99651cad2608f40a545f81552ad33f301 Mon Sep 17 00:00:00 2001 From: Ma5onic <18509613+Ma5onic@users.noreply.github.com> Date: Mon, 15 Aug 2022 01:31:27 -0400 Subject: [PATCH 2/3] Add more descriptive timer output --- predict_blend.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/predict_blend.py b/predict_blend.py index 32faa4c..1909b6b 100644 --- a/predict_blend.py +++ b/predict_blend.py @@ -57,7 +57,10 @@ def demix_base(self, mix): tar_signal = tar_waves[:,:,trim:-trim].transpose(0,1).reshape(2, -1).numpy()[:, :-pad] sources.append(tar_signal) + print("\n======================================") + print("Time to execute demix_base(self, mix):") print(time()-start_time) + print("======================================\n") return np.array(sources) def demix_demucs(self, mix): @@ -71,7 +74,10 @@ def demix_demucs(self, mix): sources = (sources * ref.std() + ref.mean()).cpu().numpy() sources[[0,1]] = sources[[1,0]] + print("\n========================================") + print("Time to execute demix_demucs(self, mix):") print(time() - start_time) + print("========================================\n") return sources From c67f8ef4e5b538ecab1c629520f9ee0e2fa953de Mon Sep 17 00:00:00 2001 From: Ma5onic <18509613+Ma5onic@users.noreply.github.com> Date: Sun, 28 Aug 2022 17:20:47 -0400 Subject: [PATCH 3/3] added binder link --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 12078ef..e2a0d22 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ## MDX-Net Track B Submission +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Ma5onic/mdx-net-submission/leaderboard_B) This branch contains the source code and the pretrained model that is submitted to the [Sony MDX Challenge](https://www.aicrowd.com/challenges/music-demixing-challenge-ismir-2021) Track B. @@ -60,4 +61,4 @@ Just do conda activate mdx-submit ``` -to go back into the environment you have installed MDX's dependencies in. \ No newline at end of file +to go back into the environment you have installed MDX's dependencies in.