We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Similar to #100 we want to speed up audinterface.Segment when processing several files.
audinterface.Segment
At the moment we get:
import pandas as pd import audb import audinterface import audiofile db = audb.load( 'emodb', version='1.3.0', format='wav', sampling_rate=16000, mixdown=True, ) files = db.files def process_func(x, sr): return pd.MultiIndex.from_tuples( [(pd.to_timedelta(0), pd.to_timedelta(1))], names=['start', 'end'], ) # slow segment = audinterface.Segment( process_func=process_func, ) t = time.time() index_slow = segment.process_files(files) print(time.time() - t) # fast t = time.time() starts = [] ends = [] for idx, file in enumerate(files): signal, sampling_rate = audiofile.read(file) index = process_func( signal, sampling_rate, ) starts += list(index.get_level_values('start')) ends += list(index.get_level_values('end')) index_fast = pd.MultiIndex.from_arrays( [files, starts, ends], names=['file', 'start', 'end'], ) print(time.time() - t) pd.testing.assert_index_equal(index_slow, index_fast)
4.128075122833252 1.7938168048858643
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Similar to #100 we want to speed up
audinterface.Segment
when processing several files.At the moment we get:
The text was updated successfully, but these errors were encountered: