Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatible with Tensorflow 1.1.0rc1 + Python 3.5.2 #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lordet01
Copy link

Here is the patch files for compatible with TF 1.1.0 + Python 3.
In addition, I wrote a simple script to enhance multiple wave files in a folder.

I am also sharing the model that was trained from my PC with the modified codes.
https://drive.google.com/open?id=0BzoVVRWvLDl1ajNtTHdDaHpZT0E
https://drive.google.com/open?id=0BzoVVRWvLDl1T0R2NFBlMVV1VW8
https://drive.google.com/open?id=0BzoVVRWvLDl1a3hWWUc1Si1OeW8

Best regards,

-Kwang Myung Jeon

@rafaelvalle
Copy link

Please also use the code below to replace the clean method on the SEGAN class because it is extremely slow.

def clean(self, x):
    """ clean a utterance x
        x: numpy array containing the normalized noisy waveform
    """
    # zero pad if necessary
    remainder = len(x) % (2 ** 14)
    if remainder != 0:
        x = np.pad(x, (0, 2**14 - remainder), 'constant', constant_values=0)
    # split files into equal 2 ** 14 sample chunks
    x = np.array(np.array_split(x, int(len(x) / 2 ** 14)))
    x_ = np.zeros((self.batch_size, 2 ** 14))
    x_[:len(x)] = x
    fdict = {self.gtruth_noisy[0]: x_}
    output = self.sess.run(self.Gs[0], feed_dict=fdict)[:len(x)]
    output = output.flatten()
    # remove zero padding if added
    if remainder != 0:
        output = output[:-(2**14 - remainder)]
    return output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants