This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.widgets import Slider, Button, RadioButtons | |
import librosa | |
fig, ax = plt.subplots() | |
plt.subplots_adjust(left=0.1, bottom=0.35) | |
samples = 1 | |
audio, sr = librosa.core.load("Snare.wav") # load your audio here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
class DataLoader(): | |
def __init__(self, data_path, data_shape, index_path = 0, batch_size = 1): | |
self.data_path = data_path | |
self.data_shape = data_shape | |
self.data_index = self._load_data_index(index_path) if index_path else self._create_data_index(data_path) | |
self.shuffled_index = self.data_index | |
self.batch_size = batch_size |
NewerOlder