├── .gitignore ├── GT.py ├── IBM.py ├── IRM.py ├── LICENSE ├── MIX.py ├── MWF.py ├── Pipfile ├── Pipfile.lock ├── README.md ├── requirements.txt └── sisec18.sh /.gitignore: -------------------------------------------------------------------------------- 1 | #### joe made this: http://goel.io/joe. 2 | 3 | .env/ 4 | *.wav 5 | 6 | #####=== Python ===##### 7 | 8 | # Byte-compiled / optimized / DLL files 9 | __pycache__/ 10 | *.py[cod] 11 | *$py.class 12 | 13 | # C extensions 14 | *.so 15 | 16 | # Distribution / packaging 17 | .Python 18 | env/ 19 | build/ 20 | develop-eggs/ 21 | dist/ 22 | downloads/ 23 | eggs/ 24 | .eggs/ 25 | lib/ 26 | lib64/ 27 | parts/ 28 | sdist/ 29 | var/ 30 | *.egg-info/ 31 | .installed.cfg 32 | *.egg 33 | 34 | # PyInstaller 35 | # Usually these files are written by a python script from a template 36 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 37 | *.manifest 38 | *.spec 39 | 40 | # Installer logs 41 | pip-log.txt 42 | pip-delete-this-directory.txt 43 | 44 | # Unit test / coverage reports 45 | htmlcov/ 46 | .tox/ 47 | .coverage 48 | .coverage.* 49 | .cache 50 | nosetests.xml 51 | coverage.xml 52 | *,cover 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | 61 | # Sphinx documentation 62 | docs/_build/ 63 | 64 | # PyBuilder 65 | target/ 66 | #### joe made this: http://goel.io/joe 67 | 68 | #####=== OSX ===##### 69 | .DS_Store 70 | .AppleDouble 71 | .LSOverride 72 | 73 | # Icon must end with two \r 74 | Icon 75 | 76 | # Thumbnails 77 | ._* 78 | 79 | # Files that might appear in the root of a volume 80 | .DocumentRevisions-V100 81 | .fseventsd 82 | .Spotlight-V100 83 | .TemporaryItems 84 | .Trashes 85 | .VolumeIcon.icns 86 | 87 | # Directories potentially created on remote AFP share 88 | .AppleDB 89 | .AppleDesktop 90 | Network Trash Folder 91 | Temporary Items 92 | .apdisk 93 | 94 | -------------------------------------------------------------------------------- /GT.py: -------------------------------------------------------------------------------- 1 | import musdb 2 | import museval 3 | import argparse 4 | import functools 5 | 6 | 7 | def GT(track, eval_dir=None): 8 | """Ground Truth Signals 9 | """ 10 | 11 | # perform separtion 12 | estimates = {} 13 | for name, target in track.targets.items(): 14 | # set accompaniment source 15 | estimates[name] = target.audio 16 | 17 | if eval_dir is not None: 18 | museval.eval_mus_track( 19 | track, 20 | estimates, 21 | output_dir=eval_dir, 22 | ) 23 | 24 | return estimates 25 | 26 | 27 | if __name__ == '__main__': 28 | parser = argparse.ArgumentParser( 29 | description='Evaluate on Ground Truth Targets' 30 | ) 31 | parser.add_argument( 32 | '--audio_dir', 33 | nargs='?', 34 | help='Folder where audio results are saved' 35 | ) 36 | 37 | parser.add_argument( 38 | '--eval_dir', 39 | nargs='?', 40 | help='Folder where evaluation results are saved' 41 | ) 42 | 43 | args = parser.parse_args() 44 | 45 | # initiate musdb 46 | mus = musdb.DB() 47 | 48 | mus.run( 49 | functools.partial(GT, eval_dir=args.eval_dir), 50 | estimates_dir=args.audio_dir, 51 | subsets='test', 52 | parallel=True, 53 | cpus=2 54 | ) 55 | -------------------------------------------------------------------------------- /IBM.py: -------------------------------------------------------------------------------- 1 | import musdb 2 | import museval 3 | import numpy as np 4 | import functools 5 | import argparse 6 | from scipy.signal import stft, istft 7 | 8 | 9 | def IBM(track, alpha=1, theta=0.5, eval_dir=None): 10 | """Ideal Binary Mask: 11 | processing all channels inpependently with the ideal binary mask. 12 | 13 | the mix is send to some source if the spectrogram of that source over that 14 | of the mix is greater than theta, when the spectrograms are take as 15 | magnitude of STFT raised to the power alpha. Typical parameters involve a 16 | ratio of magnitudes (alpha=1) and a majority vote (theta = 0.5) 17 | """ 18 | 19 | # parameters for STFT 20 | nfft = 2048 21 | 22 | # small epsilon to avoid dividing by zero 23 | eps = np.finfo(np.float).eps 24 | 25 | # compute STFT of Mixture 26 | N = track.audio.shape[0] # remember number of samples for future use 27 | X = stft(track.audio.T, nperseg=nfft)[-1] 28 | (I, F, T) = X.shape 29 | 30 | # perform separtion 31 | estimates = {} 32 | accompaniment_source = 0 33 | for name, source in track.sources.items(): 34 | 35 | # compute STFT of target source 36 | Yj = stft(source.audio.T, nperseg=nfft)[-1] 37 | 38 | # Create Binary Mask 39 | Mask = np.divide(np.abs(Yj)**alpha, (eps + np.abs(X)**alpha)) 40 | Mask[np.where(Mask >= theta)] = 1 41 | Mask[np.where(Mask < theta)] = 0 42 | 43 | # multiply mask 44 | Yj = np.multiply(X, Mask) 45 | 46 | # inverte to time domain and set same length as original mixture 47 | target_estimate = istft(Yj)[1].T[:N, :] 48 | 49 | # set this as the source estimate 50 | estimates[name] = target_estimate 51 | 52 | # accumulate to the accompaniment if this is not vocals 53 | if name != 'vocals': 54 | accompaniment_source += target_estimate 55 | 56 | # set accompaniment source 57 | estimates['accompaniment'] = accompaniment_source 58 | 59 | if eval_dir is not None: 60 | museval.eval_mus_track( 61 | track, 62 | estimates, 63 | output_dir=eval_dir, 64 | ) 65 | 66 | return estimates 67 | 68 | 69 | if __name__ == '__main__': 70 | parser = argparse.ArgumentParser( 71 | description='Evaluate Ideal Binary Mask' 72 | ) 73 | parser.add_argument( 74 | '--audio_dir', 75 | nargs='?', 76 | help='Folder where audio results are saved' 77 | ) 78 | 79 | parser.add_argument( 80 | '--eval_dir', 81 | nargs='?', 82 | help='Folder where evaluation results are saved' 83 | ) 84 | 85 | parser.add_argument( 86 | '--alpha', 87 | type=int, 88 | default=1, 89 | help='exponent for the ratio Mask' 90 | ) 91 | 92 | parser.add_argument( 93 | '--theta', 94 | type=float, 95 | default=0.5, 96 | help='threshold parameter' 97 | ) 98 | 99 | args = parser.parse_args() 100 | 101 | # default parameters 102 | alpha = args.alpha 103 | theta = args.theta 104 | 105 | # initiate musdb 106 | mus = musdb.DB() 107 | 108 | mus.run( 109 | functools.partial( 110 | IBM, alpha=alpha, theta=theta, eval_dir=args.eval_dir 111 | ), 112 | estimates_dir=args.audio_dir, 113 | subsets='test', 114 | parallel=True, 115 | cpus=2 116 | ) 117 | -------------------------------------------------------------------------------- /IRM.py: -------------------------------------------------------------------------------- 1 | import musdb 2 | import museval 3 | import numpy as np 4 | import functools 5 | import argparse 6 | from scipy.signal import stft, istft 7 | 8 | 9 | def IRM(track, alpha=2, eval_dir=None): 10 | """Ideal Ratio Mask: 11 | processing all channels inpependently with the ideal ratio mask. 12 | this is the ratio of spectrograms, where alpha is the exponent to take for 13 | spectrograms. usual values are 1 (magnitude) and 2 (power)""" 14 | 15 | # STFT parameters 16 | nfft = 2048 17 | 18 | # small epsilon to avoid dividing by zero 19 | eps = np.finfo(np.float).eps 20 | 21 | # compute STFT of Mixture 22 | N = track.audio.shape[0] # remember number of samples for future use 23 | X = stft(track.audio.T, nperseg=nfft)[-1] 24 | (I, F, T) = X.shape 25 | 26 | # Compute sources spectrograms 27 | P = {} 28 | # compute model as the sum of spectrograms 29 | model = eps 30 | 31 | for name, source in track.sources.items(): 32 | # compute spectrogram of target source: 33 | # magnitude of STFT to the power alpha 34 | P[name] = np.abs(stft(source.audio.T, nperseg=nfft)[-1])**alpha 35 | model += P[name] 36 | 37 | # now performs separation 38 | estimates = {} 39 | accompaniment_source = 0 40 | for name, source in track.sources.items(): 41 | # compute soft mask as the ratio between source spectrogram and total 42 | Mask = np.divide(np.abs(P[name]), model) 43 | 44 | # multiply the mix by the mask 45 | Yj = np.multiply(X, Mask) 46 | 47 | # invert to time domain 48 | target_estimate = istft(Yj)[1].T[:N, :] 49 | 50 | # set this as the source estimate 51 | estimates[name] = target_estimate 52 | 53 | # accumulate to the accompaniment if this is not vocals 54 | if name != 'vocals': 55 | accompaniment_source += target_estimate 56 | 57 | estimates['accompaniment'] = accompaniment_source 58 | 59 | if eval_dir is not None: 60 | museval.eval_mus_track( 61 | track, 62 | estimates, 63 | output_dir=eval_dir, 64 | ) 65 | 66 | return estimates 67 | 68 | 69 | if __name__ == '__main__': 70 | parser = argparse.ArgumentParser( 71 | description='Evaluate Ideal Ratio Mask' 72 | ) 73 | parser.add_argument( 74 | '--audio_dir', 75 | nargs='?', 76 | help='Folder where audio results are saved' 77 | ) 78 | 79 | parser.add_argument( 80 | '--eval_dir', 81 | nargs='?', 82 | help='Folder where evaluation results are saved' 83 | ) 84 | 85 | parser.add_argument( 86 | '--alpha', 87 | type=int, 88 | default=2, 89 | help='exponent for the ratio Mask' 90 | ) 91 | 92 | args = parser.parse_args() 93 | 94 | alpha = args.alpha 95 | 96 | # initiate musdb 97 | mus = musdb.DB() 98 | 99 | mus.run( 100 | functools.partial( 101 | IRM, alpha=alpha, eval_dir=args.eval_dir 102 | ), 103 | estimates_dir=args.audio_dir, 104 | subsets='test', 105 | parallel=True, 106 | cpus=2 107 | ) 108 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Fabian-Robert Stöter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MIX.py: -------------------------------------------------------------------------------- 1 | import musdb 2 | import museval 3 | import functools 4 | import argparse 5 | 6 | 7 | def MIX(track, eval_dir=None): 8 | """Mixture as Estimate 9 | """ 10 | 11 | # perform separtion 12 | estimates = {} 13 | for name, target in track.sources.items(): 14 | # set accompaniment source 15 | estimates[name] = track.audio / len(track.sources) 16 | 17 | estimates['accompaniment'] = estimates['bass'] + \ 18 | estimates['drums'] + estimates['other'] 19 | 20 | if eval_dir is not None: 21 | museval.eval_mus_track( 22 | track, 23 | estimates, 24 | output_dir=eval_dir, 25 | ) 26 | 27 | return estimates 28 | 29 | 30 | if __name__ == '__main__': 31 | parser = argparse.ArgumentParser( 32 | description='Evaluate Mixture as Estimate' 33 | ) 34 | parser.add_argument( 35 | '--audio_dir', 36 | nargs='?', 37 | help='Folder where audio results are saved' 38 | ) 39 | 40 | parser.add_argument( 41 | '--eval_dir', 42 | nargs='?', 43 | help='Folder where evaluation results are saved' 44 | ) 45 | 46 | args = parser.parse_args() 47 | 48 | # initiate musdb 49 | mus = musdb.DB() 50 | 51 | mus.run( 52 | functools.partial( 53 | MIX, eval_dir=args.eval_dir 54 | ), 55 | estimates_dir=args.audio_dir, 56 | subsets='test', 57 | parallel=True, 58 | cpus=2 59 | ) 60 | -------------------------------------------------------------------------------- /MWF.py: -------------------------------------------------------------------------------- 1 | import musdb 2 | import museval 3 | import numpy as np 4 | import itertools 5 | import functools 6 | import argparse 7 | from scipy.signal import stft, istft 8 | 9 | 10 | def invert(M, eps): 11 | """"inverting matrices M (matrices are the two last dimensions). 12 | This is assuming that these are 2x2 matrices, using the explicit 13 | inversion formula available in that case.""" 14 | invDet = 1.0/(eps + M[..., 0, 0]*M[..., 1, 1] - M[..., 0, 1]*M[..., 1, 0]) 15 | invM = np.zeros(M.shape, dtype='complex') 16 | invM[..., 0, 0] = invDet*M[..., 1, 1] 17 | invM[..., 1, 0] = -invDet*M[..., 1, 0] 18 | invM[..., 0, 1] = -invDet*M[..., 0, 1] 19 | invM[..., 1, 1] = invDet*M[..., 0, 0] 20 | return invM 21 | 22 | 23 | def MWF(track, eval_dir=None): 24 | """Multichannel Wiener Filter: 25 | processing all channels jointly with the ideal multichannel filter 26 | based on the local gaussian model, assuming time invariant spatial 27 | covariance matrix.""" 28 | 29 | # to avoid dividing by zero 30 | eps = np.finfo(np.float).eps 31 | 32 | # parameters for STFT 33 | nfft = 2048 34 | 35 | # compute STFT of Mixture 36 | N = track.audio.shape[0] # remember number of samples for future use 37 | X = stft(track.audio.T, nperseg=nfft)[-1] 38 | (I, F, T) = X.shape 39 | 40 | # Allocate variables P: PSD, R: Spatial Covarianc Matrices 41 | P = {} 42 | R = {} 43 | for name, source in track.sources.items(): 44 | 45 | # compute STFT of target source 46 | Yj = stft(source.audio.T, nperseg=nfft)[-1] 47 | 48 | # Learn Power Spectral Density and spatial covariance matrix 49 | # ----------------------------------------------------------- 50 | 51 | # 1/ compute observed covariance for source 52 | Rjj = np.zeros((F, T, I, I), dtype='complex') 53 | for (i1, i2) in itertools.product(range(I), range(I)): 54 | Rjj[..., i1, i2] = Yj[i1, ...] * np.conj(Yj[i2, ...]) 55 | 56 | # 2/ compute first naive estimate of the source spectrogram as the 57 | # average of spectrogram over channels 58 | P[name] = np.mean(np.abs(Yj)**2, axis=0) 59 | 60 | # 3/ take the spatial covariance matrix as the average of 61 | # the observed Rjj weighted Rjj by 1/Pj. This is because the 62 | # covariance is modeled as Pj Rj 63 | R[name] = np.mean(Rjj / (eps+P[name][..., None, None]), axis=1) 64 | 65 | # add some regularization to this estimate: normalize and add small 66 | # identify matrix, so we are sure it behaves well numerically. 67 | R[name] = R[name] * I / np.trace(R[name]) + eps * np.tile( 68 | np.eye(I, dtype='complex64')[None, ...], (F, 1, 1) 69 | ) 70 | 71 | # 4/ Now refine the power spectral density estimate. This is to better 72 | # estimate the PSD in case the source has some correlations between 73 | # channels. 74 | 75 | # invert Rj 76 | Rj_inv = invert(R[name], eps) 77 | 78 | # now compute the PSD 79 | P[name] = 0 80 | for (i1, i2) in itertools.product(range(I), range(I)): 81 | P[name] += 1./I*np.real( 82 | Rj_inv[:, i1, i2][:, None]*Rjj[..., i2, i1] 83 | ) 84 | 85 | # All parameters are estimated. compute the mix covariance matrix as 86 | # the sum of the sources covariances. 87 | Cxx = 0 88 | for name, source in track.sources.items(): 89 | Cxx += P[name][..., None, None]*R[name][:, None, ...] 90 | 91 | # we need its inverse for computing the Wiener filter 92 | invCxx = invert(Cxx, eps) 93 | 94 | # now separate sources 95 | estimates = {} 96 | accompaniment_source = 0 97 | for name, source in track.sources.items(): 98 | # computes multichannel Wiener gain as Pj Rj invCxx 99 | G = np.zeros(invCxx.shape, dtype='complex64') 100 | SR = P[name][..., None, None]*R[name][:, None, ...] 101 | for (i1, i2, i3) in itertools.product(range(I), range(I), range(I)): 102 | G[..., i1, i2] += SR[..., i1, i3]*invCxx[..., i3, i2] 103 | SR = 0 # free memory 104 | 105 | # separates by (matrix-)multiplying this gain with the mix. 106 | Yj = 0 107 | for i in range(I): 108 | Yj += G[..., i]*X[i, ..., None] 109 | Yj = np.rollaxis(Yj, -1) # gets channels back in first position 110 | 111 | # inverte to time domain 112 | target_estimate = istft(Yj)[1].T[:N, :] 113 | 114 | # set this as the source estimate 115 | estimates[name] = target_estimate 116 | 117 | # accumulate to the accompaniment if this is not vocals 118 | if name != 'vocals': 119 | accompaniment_source += target_estimate 120 | 121 | estimates['accompaniment'] = accompaniment_source 122 | 123 | if eval_dir is not None: 124 | museval.eval_mus_track( 125 | track, 126 | estimates, 127 | output_dir=eval_dir, 128 | ) 129 | 130 | return estimates 131 | 132 | 133 | if __name__ == '__main__': 134 | parser = argparse.ArgumentParser( 135 | description='Evaluate Multichannel Wiener Filter' 136 | ) 137 | parser.add_argument( 138 | '--audio_dir', 139 | nargs='?', 140 | help='Folder where audio results are saved' 141 | ) 142 | 143 | parser.add_argument( 144 | '--eval_dir', 145 | nargs='?', 146 | help='Folder where evaluation results are saved' 147 | ) 148 | 149 | args = parser.parse_args() 150 | 151 | # initiate musdb 152 | mus = musdb.DB() 153 | 154 | mus.run( 155 | functools.partial( 156 | MWF, eval_dir=args.eval_dir 157 | ), 158 | estimates_dir=args.audio_dir, 159 | subsets='test', 160 | parallel=True, 161 | cpus=2 162 | ) 163 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | 3 | url = "https://pypi.python.org/simple" 4 | verify_ssl = true 5 | name = "pypi" 6 | 7 | 8 | [packages] 9 | 10 | scipy = "*" 11 | numpy = "*" 12 | musdb = ">=0.2.1" 13 | museval = ">=0.2.0" 14 | 15 | 16 | [dev-packages] 17 | 18 | 19 | 20 | [requires] 21 | 22 | python_version = "3.6" 23 | -------------------------------------------------------------------------------- /Pipfile.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_meta": { 3 | "hash": { 4 | "sha256": "e234233a22ea1cb5f8f76b32c1173d26de0761dd79a0b9d8d47f4bc4972818b3" 5 | }, 6 | "pipfile-spec": 6, 7 | "requires": { 8 | "python_version": "3.6" 9 | }, 10 | "sources": [ 11 | { 12 | "name": "pypi", 13 | "url": "https://pypi.python.org/simple", 14 | "verify_ssl": true 15 | } 16 | ] 17 | }, 18 | "default": { 19 | "cffi": { 20 | "hashes": [ 21 | "sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743", 22 | "sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef", 23 | "sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50", 24 | "sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f", 25 | "sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93", 26 | "sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257", 27 | "sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3", 28 | "sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc", 29 | "sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04", 30 | "sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6", 31 | "sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359", 32 | "sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596", 33 | "sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b", 34 | "sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd", 35 | "sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95", 36 | "sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e", 37 | "sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6", 38 | "sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca", 39 | "sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31", 40 | "sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1", 41 | "sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085", 42 | "sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801", 43 | "sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4", 44 | "sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184", 45 | "sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917", 46 | "sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f", 47 | "sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb" 48 | ], 49 | "version": "==1.11.5" 50 | }, 51 | "jsonschema": { 52 | "hashes": [ 53 | "sha256:000e68abd33c972a5248544925a0cae7d1125f9bf6c58280d37546b946769a08", 54 | "sha256:6ff5f3180870836cae40f06fa10419f557208175f13ad7bc26caa77beb1f6e02" 55 | ], 56 | "version": "==2.6.0" 57 | }, 58 | "musdb": { 59 | "hashes": [ 60 | "sha256:452f2e0f4c1630970931d19804c014e1c32e59fa90fcf7b9577af4d3dec60058", 61 | "sha256:bf6656e1a0536c824976520e05e22011d3664bb7f72a14696e901c98c19e6923" 62 | ], 63 | "version": "==0.2.3" 64 | }, 65 | "museval": { 66 | "hashes": [ 67 | "sha256:0cb8d177aba001af1cb7d7e0795ddf5151db944db22707fa9313a28d5c17efa5", 68 | "sha256:2f3cf7968fdead019e8775c756d257a52b7ddd3fc70a2def9fe49bbaf3f3b2b3" 69 | ], 70 | "version": "==0.2.0" 71 | }, 72 | "numpy": { 73 | "hashes": [ 74 | "sha256:0739146eaf4985962f07c62f7133aca89f3a600faac891ce6c7f3a1e2afe5272", 75 | "sha256:07e21f14490324cc1160db101e9b6c1233c33985af4cb1d301dd02650fea1d7f", 76 | "sha256:0f6a5ed0cd7ab1da11f5c07a8ecada73fc55a70ef7bb6311a4109891341d7277", 77 | "sha256:0fd65cbbfdbf76bbf80c445d923b3accefea0fe2c2082049e0ce947c81fe1d3f", 78 | "sha256:20cac3123d791e4bf8482a580d98d6b5969ba348b9d5364df791ba3a666b660d", 79 | "sha256:528ce59ded2008f9e8543e0146acb3a98a9890da00adf8904b1e18c82099418b", 80 | "sha256:56e392b7c738bd70e6f46cf48c8194d3d1dd4c5a59fae4b30c58bb6ef86e5233", 81 | "sha256:675e0f23967ce71067d12b6944add505d5f0a251f819cfb44bdf8ee7072c090d", 82 | "sha256:6be6b0ca705321c178c9858e5ad5611af664bbdfae1df1541f938a840a103888", 83 | "sha256:719d914f564f35cce4dc103808f8297c807c9f0297ac183ed81ae8b5650e698e", 84 | "sha256:768e777cc1ffdbf97c507f65975c8686ebafe0f3dc8925d02ac117acc4669ce9", 85 | "sha256:7f76d406c6b998d6410198dcb82688dcdaec7d846aa87e263ccf52efdcfeba30", 86 | "sha256:8c18ee4dddd5c6a811930c0a7c7947bf16387da3b394725f6063f1366311187d", 87 | "sha256:99051e03b445117b26028623f1a487112ddf61a09a27e2d25e6bc07d37d94f25", 88 | "sha256:a1413d06abfa942ca0553bf3bccaff5fdb36d55b84f2248e36228db871147dab", 89 | "sha256:a7157c9ac6bddd2908c35ef099e4b643bc0e0ebb4d653deb54891d29258dd329", 90 | "sha256:a958bf9d4834c72dee4f91a0476e7837b8a2966dc6fcfc42c421405f98d0da51", 91 | "sha256:bb370120de6d26004358611441e07acda26840e41dfedc259d7f8cc613f96495", 92 | "sha256:d0928076d9bd8a98de44e79b1abe50c1456e7abbb40af7ef58092086f1a6c729", 93 | "sha256:d858423f5ed444d494b15c4cc90a206e1b8c31354c781ac7584da0d21c09c1c3", 94 | "sha256:e6120d63b50e2248219f53302af7ec6fa2a42ed1f37e9cda2c76dbaca65036a7", 95 | "sha256:f2b1378b63bdb581d5d7af2ec0373c8d40d651941d283a2afd7fc71184b3f570", 96 | "sha256:facc6f925c3099ac01a1f03758100772560a0b020fb9d70f210404be08006bcb" 97 | ], 98 | "version": "==1.14.2" 99 | }, 100 | "pyaml": { 101 | "hashes": [ 102 | "sha256:66623c52f34d83a2c0fc963e08e8b9d0c13d88404e3b43b1852ef71eda19afa3", 103 | "sha256:f83fc302c52c6b83a15345792693ae0b5bc07ad19f59e318b7617d7123d62990" 104 | ], 105 | "version": "==17.12.1" 106 | }, 107 | "pycparser": { 108 | "hashes": [ 109 | "sha256:99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226" 110 | ], 111 | "version": "==2.18" 112 | }, 113 | "pyyaml": { 114 | "hashes": [ 115 | "sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736", 116 | "sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f", 117 | "sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab", 118 | "sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7", 119 | "sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1", 120 | "sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8", 121 | "sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4", 122 | "sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269" 123 | ], 124 | "version": "==3.12" 125 | }, 126 | "scipy": { 127 | "hashes": [ 128 | "sha256:103fd8253fd3f0df3f50a554abc01b13bee1d70483f23bb03636a74b0a0cbc71", 129 | "sha256:11cddcfc348ef593feb4ffe4b69c18a064eca199602f751d34083838bdc2f05a", 130 | "sha256:164f774de04e546fd10e1894d423b54e36255bb42887e005f0fbfb8eef6736f1", 131 | "sha256:1766acf2d8ff79ed59cae841d4272587af94772f513619dd217226027bd2ab76", 132 | "sha256:200ca3dfebbd0bbacbc0d7389e6eda77428b49793cc1e0e3247f835687d1a6be", 133 | "sha256:232a848a9935c37ffe2cade857296a13680724aef7d4623160dd08f99dbb9d02", 134 | "sha256:3eb28bdc6f40a964761c1cb339e45fef076ea2ca729886e1bce956932ef7e487", 135 | "sha256:3fab61f6ffbc1da9e1f8e813ba235929b5f361c1fdd728d120ead8f78560427c", 136 | "sha256:4a2837b07e77f8e2fc5303f38e224d7fd9f79f8cbf9c60ac72cf98594e1db6b5", 137 | "sha256:4a9f5a3adbfd08dd047de48a6b436bd4dae364913aa5b6349a41e9eaeb774050", 138 | "sha256:544e6f7796b9c131f8f965967e806da187553abf5d7766278b96a2a76abd19a7", 139 | "sha256:76f32095863f7eccecaf5224624d4c7f0f3b922b2cd0d0b0d6f037e4d9c54db6", 140 | "sha256:800abaa55cfad422f00f5b3802403dd634ab9888f560731c09977a3c35e0acae", 141 | "sha256:823a4b1a2eabd09f9e72003c14ceaac63f54d1f99a49f8c1b534f6a73135e995", 142 | "sha256:8739c67842ed9a1c34c62d6cca6301d0ade40d50ef14ba292bd331f0d6c940ba", 143 | "sha256:89c1d2a80760a373e7f12f490446c60a7221b641435a789439e8ddb01f5ab7d4", 144 | "sha256:a3287b438b3c13970c4851a34bbc82db11e4680d1d6cdedd066479ca83028042", 145 | "sha256:be6f0af3f591c100923158f3e3f0f12fa16a0b231616eda407c528e1f9e10014", 146 | "sha256:cc04cf28b9f77255eeb612af41a6f207142f92a082555871f782c773c83b7789", 147 | "sha256:cc85b9d10a5da07a6b27449d17584b1a3d953f7286189f170a6045c6c297b0bc", 148 | "sha256:f26e54dcdeec3daff6ec71854a7b3bba719b78cf07e2d23645ee09d67a5e93df", 149 | "sha256:f2a51f70ef868c03430ed40d8983daa2f38d2e2160a0de4b57b7d9d070912c76", 150 | "sha256:f7c0624de958e2e2e6353813c78aa4f5f3f1ed0a3567fb496b6dad99f55e695e" 151 | ], 152 | "version": "==1.0.1" 153 | }, 154 | "simplejson": { 155 | "hashes": [ 156 | "sha256:194fa08e4047f16e7087f2a406abd15151a482a097e42d8babb1b8181b2232b1", 157 | "sha256:43dc3082f3a8fd5bb0c80df5a8ab96d81eafeca701615aaa0b01910b1869e678", 158 | "sha256:44a7e0e117032666d37bcfa42161c7eb27c6ed9100d260e5b25751a6d8d7a2e8", 159 | "sha256:4c4ecf20e054716cc1e5a81cadc44d3f4027108d8dd0861d8b1e3bd7a32d4f0a", 160 | "sha256:5539547ba11f4affcdc4890cc85bfdd3f2d7186042d91e9340add98699cc3d50", 161 | "sha256:6560b68e98aba17afa4e898aab21d06d549738267dbe4d0981a24b4c1db66368", 162 | "sha256:6cf42bc495f7e3fd25e92912a22f47e439f3a809814103a1b727d373f758915a", 163 | "sha256:b2e64d1695bcd0d916e8633ab12179bde8d96e8cbd18d9d0c3020409cfaf8091", 164 | "sha256:b4967af248c1fde0b184d81b2aa9646d96a400342d26f837e772a1dcb11cdc10", 165 | "sha256:c1347a0d6e90d4a0fd67514c8691346c5cd1ee6039415eba97690f4b5d594915", 166 | "sha256:cf669980df3a6db918e69920df3eaf52901aa4c007287070a8b6e0da811cd2a2", 167 | "sha256:ef822f66d932a7ced43844a4684d7bd24c4cc7ebe8030ee7277cf7c033e58a13" 168 | ], 169 | "version": "==3.13.2" 170 | }, 171 | "six": { 172 | "hashes": [ 173 | "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", 174 | "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" 175 | ], 176 | "version": "==1.11.0" 177 | }, 178 | "soundfile": { 179 | "hashes": [ 180 | "sha256:1135fa425dc64e17144dfff5ab1f943f37d2a033a24313e3768ea8eedb10da80", 181 | "sha256:2746f1610b97f2e580ba5e7b79c4a8c5f0dbd15da7133c809e15ef62ec415ceb", 182 | "sha256:33c2adfeb98d37f7c9061de2d6aa058bb8900b0b9d3652644b3649274e7592fb", 183 | "sha256:8e841dd7ccf1b2dc064c19271df95ee8b53868e8edb7a0df2873e0144010154d", 184 | "sha256:b112631b8d4422b6ecb7abb612ebaae21db85debee8af4092ad30650221f80c9" 185 | ], 186 | "version": "==0.10.1" 187 | }, 188 | "stempeg": { 189 | "hashes": [ 190 | "sha256:03b88aef44a8f2bc3aa847ecbbef3092dff736c1e530ed89819b66414a085211", 191 | "sha256:b63e147d0ab92ab4ec2d11a97ff8a8a4af4b247c147e27b267a31b923047f2c9", 192 | "sha256:bc0e9fd4d3befb799baa8c59893ba18cecc74ba979aba99ca7d7470d5c08b989" 193 | ], 194 | "version": "==0.1.3" 195 | }, 196 | "tqdm": { 197 | "hashes": [ 198 | "sha256:782aa84b61a5246c4f9e5b938875009e0b759d9a5c9d16b12e4f8deefdff7892", 199 | "sha256:eaf9c32a2cf7b9623eb272134b934eb354ef6304299611aa71e3cf47cf83c22b" 200 | ], 201 | "version": "==4.19.9" 202 | } 203 | }, 204 | "develop": {} 205 | } 206 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Oracle Source Separation Methods 2 | 3 | ## Installation 4 | 5 | Install `pipenv` using `pip install pipenv`. Then run 6 | 7 | ``` 8 | pipenv install 9 | ``` 10 | 11 | in the source folder to install all python requirements. Alternatively you can use `pip install -r requirements.txt` to install the requirements using `pip` instead of `pipenv`. 12 | 13 | ## Usage 14 | 15 | Each Oracle method comes with its a command line argument parser. To run one of the method just numerically 16 | 17 | ``` 18 | python METHOD_NAME.py --eval_dir ./Evaluation_Dir --audio_dir ./Audio_Dir 19 | ``` 20 | 21 | you can omit either `--eval_dir` or `audio_dir` (or both) to not write out the audio_files to disk or do not do the evaluation. 22 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | scipy 2 | numpy 3 | musdb==0.2.1 4 | museval>=0.2.0 5 | -------------------------------------------------------------------------------- /sisec18.sh: -------------------------------------------------------------------------------- 1 | python GT.py --eval_dir ./GT 2 | python IBM.py --alpha 1 --eval_dir ./IBM1 3 | python IBM.py --alpha 2 --eval_dir ./IBM2 4 | python IRM.py --eval_dir ./IRM 5 | python MIX.py --eval_dir ./MIX 6 | python MWF.py --eval_dir ./MWF 7 | --------------------------------------------------------------------------------