Comments (2)
What does this line in the code mean exactly?
if y.shape[0] < slice_size:
print(f'Skipping {full_path}')
continue
S = librosa.feature.melspectrogram(y=y, sr=sr, n_fft=n_fft, hop_length=hop_length, n_mels=n_mels, fmax=sr/2)
x = np.ndarray(shape=(S.shape[1] // slice_size, n_mels, slice_size, 1), dtype=float)
for slice in range(S.shape[1] // slice_size):
log_S = librosa.power_to_db(S[:, slice * slice_size : (slice+1) * slice_size], ref=np.max)
if np.max(log_S) - np.min(log_S) != 0:
log_S = (log_S - np.min(log_S)) / (np.max(log_S) - np.min(log_S))
x[slice, :, :, 0] = log_S
pickle.dump((full_path, model.predict(x)), open(dump_directory + '/' + pickle_filename, 'wb'))
except KeyboardInterrupt:
raise
except:
print(f'Skipping {full_path}')
from deej-ai.
I think we spoke on email. For anyone else coming here: if the MP3s cannot be read by librosa (which uses ffmpeg) then they will be skipped.
from deej-ai.
Related Issues (20)
- Update Readme.md to include directions for Redirect URI? HOT 3
- Is there a way to link a Spotify account with this? HOT 1
- Unable to run MP3ToVec.py HOT 3
- Unable to install requirements on Windows HOT 1
- Amazing results! HOT 1
- Getting ValueError: Unknown loss function: cosine_proximity. Please ensure this object is passed to the `custom_objects` argument. See https://www.tensorflow.org/guide/keras/save_and_serialize#registering_the_custom_object for details. when trying to run HOT 3
- Suggestion for data source: lastfm or listenbrainz HOT 1
- [Feature request] Ability to export .m3u playlist HOT 4
- m3u playlist generation: KeyError: 'file.mp3' HOT 1
- Add separate requirement file for MacOS (M1/M2) HOT 1
- python version HOT 1
- No module named 'audiodiffusion.audio_encoder'; 'audiodiffusion' is not a package HOT 4
- suggestion: skip broken files HOT 1
- KeyError generating mp3 mix or playlist HOT 5
- Analyzing local music? HOT 5
- for some reason spotify breaks the tracks scraping after 4900~, it ip banned me. HOT 3
- Developer terms restrictions? HOT 2
- wrong m3u after second scan of a library HOT 3
- Please add FLAC support HOT 2
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 deej-ai.