Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using BSSEval in this package without using musdb #51

Closed
zingmars opened this issue May 17, 2019 · 4 comments
Closed

Using BSSEval in this package without using musdb #51

zingmars opened this issue May 17, 2019 · 4 comments

Comments

@zingmars
Copy link

Hello,

I would like to use BSSEval to test the results of vocal separation, and found BSSEval. I have the original mixture, vocals and accompaniment (although I can get full stems for most of the songs, but that would take time on my end), and an estimated vocal and accompaniment.
It would appear that all of the examples and docs assume that one is using musdb. Is it possible to use BSSEval in this package to calculate the SDR, SIR and SAR values for vocal separation without using musdb, and if yes - how would one do so?

@faroit
Copy link
Member

faroit commented May 18, 2019

Hi

sure, museval.metrics.bss_eval works with any numpy arrays. See documentation here.

I agree that the documentation could better mention this. Thats why we will probably move out the metrics to a separate package soon, feel free to join the discussion in #22.

@faroit faroit closed this as completed May 18, 2019
@zingmars
Copy link
Author

Hm, I looked at that but wasn't quite sure how to use it in my situation. Simply passing both original vocals results in #36, which makes sense I guess, so I tried adding concatenating multiple sources (original vocals, accompaniment in reference array, estimated vocals and accompaniment in estimates array), but I just get this -

Traceback (most recent call last):
  File "main.py", line 83, in <module>
    evaluator.calculate_metrics()
  File "C:\Users\zingmars\Documents\Projects\separate\evaluate.py", line 86, in calculate_metrics
    sdr, _, sir, sar, _ = museval.metrics.bss_eval(original_data, estimated_data, window=np.inf, hop=0)
  File "C:\Program Files\Python37\lib\site-packages\museval\metrics.py", line 283, in bss_eval
    (G, sf, C) = compute_GsfC()
  File "C:\Program Files\Python37\lib\site-packages\museval\metrics.py", line 259, in compute_GsfC
    reference_sources[:, win], filters_len
  File "C:\Program Files\Python37\lib\site-packages\museval\metrics.py", line 525, in _compute_reference_correlations
    sf = scipy.fftpack.fft(reference_sources, n=n_fft, axis=2)
  File "C:\Program Files\Python37\lib\site-packages\scipy\fftpack\basic.py", line 284, in fft
    return work_function(tmp,n,1,0,overwrite_x)
MemoryError

Which is odd because I'm running 64-bit python and memory usage doesn't even go above 300MiB before it crashes.

@faroit
Copy link
Member

faroit commented May 18, 2019

Did you pass the right shapes?

@zingmars
Copy link
Author

Oh wow, I should probably avoid writing code at 2am next time. My arrays were

(2, 1, 5248768)
(2, 1, 5248768)

instead of

(2, 5248768, 1)
(2, 5248768, 1)

Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants