fingerprinted now should work correctly

This commit is contained in:
Si11ium 2020-05-20 13:29:16 +02:00
parent 196b1af7ae
commit b87a56e8c6
3 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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