fingerprinted now should work correctly
This commit is contained in:
parent
196b1af7ae
commit
b87a56e8c6
@ -125,4 +125,5 @@ class MelToImage(object):
|
||||
img = scale_minmax(mels, 0, 255).astype(np.uint8)
|
||||
img = np.flip(img, axis=0) # put low frequencies at the bottom in image
|
||||
img = 255 - img # invert. make black==more energy
|
||||
img = img.astype(np.float32)
|
||||
return img
|
||||
|
@ -59,9 +59,9 @@ class ShiftTime(object):
|
||||
# Set to silence for heading/ tailing
|
||||
shift = int(shift)
|
||||
if shift > 0:
|
||||
augmented_data[:shift] = 0
|
||||
augmented_data[:, :shift] = 0
|
||||
else:
|
||||
augmented_data[shift:] = 0
|
||||
augmented_data[:, shift:] = 0
|
||||
return augmented_data
|
||||
else:
|
||||
return x
|
||||
|
@ -4,5 +4,6 @@ from torchvision.transforms import ToTensor as TorchVisionToTensor
|
||||
class ToTensor(TorchVisionToTensor):
|
||||
|
||||
def __call__(self, pic):
|
||||
# Make it float .float() == 32bit
|
||||
tensor = super(ToTensor, self).__call__(pic).float()
|
||||
return tensor
|
||||
|
Loading…
x
Reference in New Issue
Block a user