medleydb icon indicating copy to clipboard operation
medleydb copied to clipboard

Add all annotation generation helper scripts

Open rabitt opened this issue 10 years ago • 14 comments

  • [x] melody annotation generator script
  • [ ] Instrument Activation script

rabitt avatar Jan 14 '16 19:01 rabitt

I ported the instrument activation script and will commit soon.

  • How would you prefer the corresponding tests to be designed? Testing against the already existing annotations?
  • Are the instrument activation annotations completely machine generated or were they user corrected?

faroit avatar Feb 14 '16 17:02 faroit

@faroit:

How would you prefer the corresponding tests to be designed? Testing against the already existing annotations?

Yes - I think it'd be ideal to test against the existing annotations. I did something similar for the melody annotations here.

One caveat - the activations for multitracks with has_bleed=True were computed with separate files that were first source-separated. So, in the unit test, only test it on multitracks with has_bleed=False and ignore the others for now.

Are the instrument activation annotations completely machine generated or were they user corrected?

Completely machine generated. One day they should probably be user corrected, or at least verified...

rabitt avatar Feb 15 '16 16:02 rabitt

:+1: roger that

faroit avatar Feb 15 '16 17:02 faroit

Working on it now.

It would be helpful to have working branch aka where tests do not fail. Could you fix the medleydb_v1.2 branch?

Currently I am getting ImportErrors:

ImportError: No module named medleydb

======================================================================
ERROR: Failure: ImportError (No module named medleydb)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/Users/stf_remote/repositories/medleydb/tests/test_utils.py", line 4, in <module>
    import medleydb
ImportError: No module named medleydb

faroit avatar Sep 25 '16 20:09 faroit

@rabitt do you need help fixing the v.1.2 branch so that it passes travis?

faroit avatar Sep 27 '16 10:09 faroit

Yes sorry about this! Will fix it today.

On Tuesday, September 27, 2016, Fabian-Robert Stöter < [email protected]> wrote:

@rabitt https://github.com/rabitt do you need help fixing the v.1.2 branch so that it passes travis?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/marl/medleydb/issues/25#issuecomment-249829195, or mute the thread https://github.com/notifications/unsubscribe-auth/AHypc7_v_w1MInumXEKtyz2MbXF8PeQbks5quPJZgaJpZM4HFMOf .

rabitt avatar Sep 27 '16 12:09 rabitt

@faroit It looks like the tests are fine - there was just a "pending check" from Review Ninja which I'm disabling. Am I missing something?

rabitt avatar Sep 27 '16 18:09 rabitt

runs fine now here on my machine as well... was a problem with nosetests... pytest is so much more robust ;-)

Anyway, now I don't have the dataset with me, but will add a WIP tomorrow

faroit avatar Sep 27 '16 22:09 faroit

another questions: For now I use scipy.signal and librosa to compute the activations. This would add quite a bit of additional dependencies. Thinking about this, I feel that the medleydb/annotate dir might be better outside the main medleydb module path. Also this would make sense to me, because you are only calling the generate_*.py functions from your unit tests. So: I would propose moving annotate to a separate directory like scripts and add the additional dependencies like scipy to the test environment in setup.py

@rabitt @bmcfee what do you think?

faroit avatar Sep 28 '16 15:09 faroit

I'm not so opposed to adding dependencies. I guess my preference would be to either keep it as is, adding the two dependencies, or alternatively to create a separate module entirely for generating automatic annotations on a multitrack.

rabitt avatar Sep 28 '16 15:09 rabitt

uh, another questions: to test the activations I need to read the wav files

  1. Is it okay to add pysoundfile as dependency? would also come in handy: I could add an audio reader method as well so that users can get the audio instead of just the path
  2. How to test this? Is testing against the medleydb samples set okay? Travis should then download this first. @rabitt Can you add this to the .travis.yml and/or a fetch shell script?

faroit avatar Sep 28 '16 16:09 faroit

  1. Can you explain why this is needed? If possible I'd prefer to just rely on librosa's audio reader
  2. yes using the medleydb samples is ok. Instead of having travis download them, what about making a very short version of one of them (say, 5-10 seconds) and adding it to tests/data? There are still tests I need to write, and having a mini-multitrack there for testing will be useful in general.

rabitt avatar Sep 28 '16 16:09 rabitt

Can you explain why this is needed? If possible I'd prefer to just rely on librosa's audio reader

oops, I always tend to forget that librosa has a wav reader. Sure I can use this instead.

what about making a very short version of one of them (say, 5-10 seconds) and adding it to tests/data?

I don't like adding unnecessary binary files to repositories. The sample set is more than 400 MB, so I would download it on demand for purpose of unit testing. You are probably not short on bandwidth at NYU, right? ;-)

By the way: test_melody_annotations fails when using just the sample set. Maybe you could add logic here...

faroit avatar Sep 28 '16 19:09 faroit

things are getting more concrete in #49 now

faroit avatar Sep 29 '16 12:09 faroit