Comments (11)
Finally I've implemented this on the 0.1.0-dev
branch. It still saves the file, but you can change the path file here (only in single-file mode).
I am planning on having a .msafrc
to write all the personal features, where this should be more easily changed (see #23).
Any suggestions/comments? Thanks!
from msaf.
This can't be disabled at the moment, but it should be easy to include. I might do it later today, thanks for the suggestion. msaf.process()
has a list of arguments right now, I will include this new argument there soon.
from msaf.
That's great, thank you for such a quick reply and change! I failed to locate msaf.process()
, thanks for that as well.
from msaf.
Ok, if you pull the latest version you should find a new save_json
parameter in the arguments of msaf.process
.
from msaf.
Thank you! I think it's still trying to write a json file though. The message is as below:
File "main_prepare.py", line 320, in <module>
boundaries, labels = msaf.process(PATH_ILM_AUDIO + dict_id_path[track_id], boundaries_id="cnmf", labels_id="cnmf", save_json=False)
File "/homes/kc306/.local/lib/python2.7/site-packages/msaf-0.0.3-py2.7.egg/msaf/run.py", line 350, in process
all_features)
File "/homes/kc306/.local/lib/python2.7/site-packages/msaf-0.0.3-py2.7.egg/msaf/featextract.py", line 158, in save_features
with open(out_file, "w") as f:
IOError: [Errno 13] Permission denied: '/import/c4dm-01/ilm10k-dataset/features/310829-10.01.json'
So I try to fix it by adding an if statement in the run.py
, but it says
File "main_prepare.py", line 320, in <module>
boundaries, labels = msaf.process(PATH_ILM_AUDIO + dict_id_path[track_id], boundaries_id="cnmf", labels_id="cnmf", save_json=False)
File "/homes/kc306/.local/lib/python2.7/site-packages/msaf-0.0.3-py2.7.egg/msaf/run.py", line 354, in process
in_path, annot_beats=annot_beats, framesync=framesync)
File "/homes/kc306/.local/lib/python2.7/site-packages/msaf-0.0.3-py2.7.egg/msaf/input_output.py", line 226, in get_features
with open(features_path, "r") as f:
I guess at the moment it first need to save a (at least temporary) json file to store the features, then use it later. Tried to modify by myself, but bit tricky as I don't see the whole structure.
from msaf.
Yeah, right now it always tries to save a temporary file to store the features
(not the estimations). I should look into that, since I can see this can be an issue, but won't be able to do it until next week or so. I will reopen this issue.
from msaf.
Hi, (I changed my account.)
I tried to modify it by myself (https://github.com/keunwoochoi/msaf/commits/issue14), but now I'm bit stuck in. Basically I'd like to make it run only by using variables in memory without writing any json files.
You can compare 04948cc and 74656e0. The former, also the latest, is one that I added a conversion function in input_output.py
to make the form of dictionary usable - but it didn't work as below (1). The latter, the second latest one, is one that almost properly works but the result shows as below (2).
PS. Also I think it would be good to have file existence check in run, i.e. os.path.exists()
before line 341 in run.py
, it might be done outside of msaf though. When the path is wrong for some reasons (my sshfs got some error so unmounted without telling me anything!), it goes to else
, where the path should be one of a directory, then it looks like it falls in a infinite loop. I'd also add this if you think it makes sense.
PS. Actually it is issue15!
(1)
Traceback (most recent call last):
File "main_prepare.py", line 337, in <module>
boundaries, labels = msaf.process(PATH_ILM_AUDIO + dict_id_path[track_id], boundaries_id="cnmf", labels_id="cnmf", save_json=False)
File "/usr/local/lib/python2.7/dist-packages/msaf-0.0.3-py2.7.egg/msaf/run.py", line 360, in process
framesync=framesync)
File "/usr/local/lib/python2.7/dist-packages/msaf-0.0.3-py2.7.egg/msaf/input_output.py", line 262, in get_features_from_memory
beats = np.asarray(feats["beats"]["times"])
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
(2)
Traceback (most recent call last):
File "main_prepare.py", line 337, in <module>
boundaries, labels = msaf.process(PATH_ILM_AUDIO + dict_id_path[track_id], boundaries_id="cnmf", labels_id="cnmf", save_json=False)
File "/usr/local/lib/python2.7/dist-packages/msaf-0.0.3-py2.7.egg/msaf/run.py", line 363, in process
annotator_id=annotator_id)
File "/usr/local/lib/python2.7/dist-packages/msaf-0.0.3-py2.7.egg/msaf/run.py", line 185, in run_algorithms_from_memory
frame_times, config, annotator_id)
File "/usr/local/lib/python2.7/dist-packages/msaf-0.0.3-py2.7.egg/msaf/run.py", line 156, in run_flat
features["anal"]["dur"])
File "/usr/local/lib/python2.7/dist-packages/msaf-0.0.3-py2.7.egg/msaf/utils.py", line 226, in process_segmentation_level
est_times = np.concatenate(([0], frame_times[est_idxs], [dur]))
IndexError: index 276 is out of bounds for axis 1 with size 264
from msaf.
If it would take more time to change the structure, how about adding a argument for temp_path
that is only used for storing those json files?
I actually did a very straightforward and non-clever workaround - by copying the data I'm using to my local folder, so it is not urgent at all, but still interested in how it would be modified.
from msaf.
Thanks for doing all of this. Unfortunately don't have time right now to dig into this, since it would require a bit of a change (as you have experienced...).
If it would take more time to change the structure, how about adding a argument for temp_path that is only used for storing those json files?
I would rather have a good solution right away instead of adding extra hacks. Maybe this could go into a different branch though.
from msaf.
I see. Thanks!
from msaf.
Closing this, it is done.
from msaf.
Related Issues (20)
- End ground truth boundaries is falsely doubled HOT 3
- Installed with pip to Python 3.6, however, elicits "DLL Load Failed" error HOT 1
- TypeError: 'float' object cannot be interpreted as an integer HOT 3
- Feature Tonnetz can't be calculated properly HOT 3
- . HOT 1
- ImportError: cannot import name 'factorial' from 'scipy.misc' HOT 3
- compiler clang error while installing package on M1 mac HOT 4
- ImportError: numpy.core.multiarray failed to import HOT 3
- ImportError: cannot import name 'factorial' from 'scipy.misc' HOT 4
- msaf.exceptions.NoAudioFileError: Couldn't find audio file inside Docker container HOT 9
- Frames to time takes 1 positional argument but 3 were given HOT 2
- Remove "yield" from tests for PyTest
- Rename default branch to `main` HOT 1
- MSAF error: Computation of the features is needed for current parameters but no audio file was found. HOT 7
- Adding a new MSA algorithm in MSAF HOT 11
- qestin
- question about label id and effect on Chinese songs HOT 1
- Implementing Barwise TF matrices (Barwise-aligned features). HOT 3
- Setting the default feature in msaf/__init__.py to a different feature than PCP still results in the computation of PCP.
- Uses of this library in production settings? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msaf.