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