-
Notifications
You must be signed in to change notification settings - Fork 525
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
Slow import #1175
Comments
In general, it would be helpful to know if there is a faster way to do this computation? This code is the only thing we need, for audio files up to 2 hours long. Processing takes ~90s for 2h audio, ~2.5s for 3 min audio, but it always has ~1.75s spent in importing essentia standard / streaming (it would be really good if we could somehow remove that lag). import sys, math, essentia
import essentia.standard
import essentia.streaming
# args
inFile = sys.argv[1]
resultFile = sys.argv[2]
# consts
samplesPerSecond = 24
freqBands = [20, 90, 200, 600, 3000, 8000, 20000]
# number of samples
sampleN = math.floor(2 * 60 * 60 * samplesPerSecond)
# time point for each sample
points = []
for sampleI in range(sampleN):
points.append(sampleI/24)
# get beat loudness and band ratio
loader = essentia.streaming.MonoLoader(filename=inFile)
beatsLoudness = essentia.streaming.BeatsLoudness(beats=points, frequencyBands=freqBands)
pool = essentia.Pool()
loader.audio >> beatsLoudness.signal
beatsLoudness.loudness >> (pool, 'loudness')
beatsLoudness.loudnessBandRatio >> (pool, 'loudnessBandRatio')
essentia.run(loader)
# output the results as json
essentia.standard.YamlOutput(format = 'json', filename = resultFile)(pool) |
anyone solved the speed issue? |
New `ESSENTIA_PYTHON_NODOC` env variable for faster Python package imports. Skip loading an instance of each algorithm to populate __doc__ and __struct__ fields in its wrapper class, when this varaible equals to 'True', 'true' or '1'.
This is solved in #1388 by setting the environment variable |
Could you please explain to us what exactly is solved? and how does it affect the speed? |
On the import, all algorithms are instantiated once to populate the Follow #1388 for future updates for when the new Python wheels are available. |
Hi guys. Thanks for this great tool!
I'm running multiple python scripts, even on demand, and there is non-trivial time that goes to importing essentia standard and essentia streaming. These two lines take ~1.75s, which is really lot, more than a third of general processing time in average:
Is there any way to speed this up (that is not a keeping running server is communicated with tasks and that executes via multiprocessing, which is also slow)?
Thanks, Aleksandar
The text was updated successfully, but these errors were encountered: