-
Notifications
You must be signed in to change notification settings - Fork 202
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
IO module #346
Conversation
a8489f2
to
d27c6b6
Compare
a6a2cd8
to
7c445f9
Compare
04029c2
to
8288e19
Compare
madmom/audio/signal.py
Outdated
raise LoadAudioFileError(error) | ||
warnings.warn(load_audio_file.__doc__) | ||
from ..io.audio import load_wave_file | ||
return load_wave_file(*args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must be load_audio_file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's a huge and important one. I have some minor comments that can be addressed easily, I think. I can take care of anything chord/key related.
bin/DCChordRecognition
Outdated
@@ -75,7 +77,7 @@ def main(): | |||
# save the deep chroma vectors to a file | |||
out_processor = ActivationsProcessor(mode='w', **vars(args)) | |||
else: | |||
# load conditional random field | |||
# regocgnise chords with a conditional random field and output them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recognise...
madmom/evaluation/chords.py
Outdated
Chords in `CHORD_ANN_DTYPE` format | ||
|
||
""" | ||
# TODO: Join consecutive labels of identical chords |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this TODO is obsolete. merge()
does this.
madmom/io/__init__.py
Outdated
SEGMENT_DTYPE = [('start', np.float), ('end', np.float), ('label', object)] | ||
|
||
|
||
def _open_file(fn): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is probably unnecessary. It can be replaced with open_file
, I guess.
@@ -51,20 +63,13 @@ class TestLoadKeyFunction(unittest.TestCase): | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests should be moved to test_io
.
tests/test_evaluation_onsets.py
Outdated
|
||
|
||
# loading function | ||
class TestLoadOnsetsFunction(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should also go to test_io
, no?
tests/test_features_chords.py
Outdated
@@ -40,30 +41,32 @@ def _compare_labels(test_case, labels, reference_labels): | |||
test_case.assertTrue((labels['label'] == reference_labels['label']).all()) | |||
|
|||
|
|||
class TestLoadSegmentsFunction(unittest.TestCase): | |||
def test_read_segments_from_file(self): | |||
class TestLoadChordsFunction(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These things should also be moved to test_io
...
…ndles refactor loading of detections/annotations for evaluation into evaluation script and add tests
utils.midi is kept and marked deprectated to enable a smooth transition
fcc1825
to
ddfe586
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a final remark, otherwise great!
madmom/io/__init__.py
Outdated
from .midi import load_midi, write_midi | ||
from ..utils import suppress_warnings, string_types | ||
|
||
if sys.version_info[0] < 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that _open_file
is gone, this can be removed as well (sorry, did not mention this in the previous comment)
Changes proposed in this pull request
This PR moves all IO functionality into a separate module. This pull request supersedes #313.
io
module is created which bundles all feature loading/writing functionality which was split among the differentfeature.x
andevaluation.y
modules,madmom.io.audio
constitutes the functionality ofaudio.ffmpeg
and all the loading functions fromaudio.signal
,evaluate
scriptWhen merged, this PR fixes #306, fixes #302 and fixes #192.
Remaining TODOs before this pull request can be merged
write_notes_midi
should go intoio.midi
load_chords
function to useload_key
toio
io.mirex
module EDIT: since this is only relevant for notes and tempowe'll leave it where it is with a distinct nameit is cleaner to move MIREX output formatting directly into the programsfilter_downbeats
to io-module or rewrite aswrite_downbeats
?expand_notes()
was moved toutils
, not sure if this is a good place