nussl/separation/base/deep_mixin.py
def _get_input_data_for_model(self, extra_data=None):
        """
        Sets up the audio signal with the appropriate STFT parameters and runs it
        through the transform found in the metadata.

        Args:
            extra_data: A dictionary containing any additional data that will 
              be merged with the output dictionary.
        
        Returns:
            dict: Data dictionary to pass into the model.
        """
        extra_data = {} if extra_data is None else extra_data
        if self.metadata['sample_rate'] is not None:
            if self.audio_signal.sample_rate != self.metadata['sample_rate']:
                self.audio_signal.resample(self.metadata['sample_rate'])

        self.audio_signal.stft_params = self.metadata['stft_params']
        self.audio_signal.stft()

        data = {'mix': self.audio_signal}
        data.update(extra_data)
        data = self.transform(data)

        for key in data:
            if torch.is_tensor(data[key]):
                data[key] = data[key].unsqueeze(0).to(self.device).float()
                if self.metadata['num_channels'] == 1:
                    # then each channel is processed indep
                    data[key] = data[key].transpose(0, self.channel_dim)
        self.input_data = data
        return self.input_data

        Sets up the audio signal with the appropriate STFT parameters and runs it
        through the transform found in the metadata.

        Args:
            extra_data: A dictionary containing any additional data that will 
              be merged with the output dictionary.
        
        Returns:
            dict: Data dictionary to pass into the model.
        
Sets up the audio signal with the appropriate STFT parameters and runs it
through the transform found in the metadata.
Sets up the audio signal with the appropriate STFT parameters and runs it through the transform found in the metadata .
def _get_input_data_for_model(self, extra_data=None):
        extra_data = {} if extra_data is None else extra_data
        if self.metadata['sample_rate'] is not None:
            if self.audio_signal.sample_rate != self.metadata['sample_rate']:
                self.audio_signal.resample(self.metadata['sample_rate'])
        self.audio_signal.stft_params = self.metadata['stft_params']
        self.audio_signal.stft()
        data = {'mix': self.audio_signal}
        data.update(extra_data)
        data = self.transform(data)
        for key in data:
            if torch.is_tensor(data[key]):
                data[key] = data[key].unsqueeze(0).to(self.device).float()
                if self.metadata['num_channels'] == 1:
                    data[key] = data[key].transpose(0, self.channel_dim)
        self.input_data = data
        return self.input_data
def _get_input_data_for_model ( self , extra_data = None ) : extra_data = { } if extra_data is None else extra_data if self . metadata [ 'sample_rate' ] is not None : if self . audio_signal . sample_rate != self . metadata [ 'sample_rate' ] : self . audio_signal . resample ( self . metadata [ 'sample_rate' ] ) self . audio_signal . stft_params = self . metadata [ 'stft_params' ] self . audio_signal . stft ( ) data = { 'mix' : self . audio_signal } data . update ( extra_data ) data = self . transform ( data ) for key in data : if torch . is_tensor ( data [ key ] ) : data [ key ] = data [ key ] . unsqueeze ( 0 ) . to ( self . device ) . float ( ) if self . metadata [ 'num_channels' ] == 1 : data [ key ] = data [ key ] . transpose ( 0 , self . channel_dim ) self . input_data = data return self . input_data
Sets up the audio signal with the appropriate STFT parameters and runs it
through the transform found in the metadata.
Sets up the audio signal with the appropriate STFT parameters and runs it through the transform found in the metadata .
"""
        Sets up the audio signal with the appropriate STFT parameters and runs it
        through the transform found in the metadata.

        Args:
            extra_data: A dictionary containing any additional data that will 
              be merged with the output dictionary.
        
        Returns:
            dict: Data dictionary to pass into the model.
        """ # then each channel is processed indep
Data dictionary to pass into the model.
Data dictionary to pass into the model .
dict
self
extra_data
A dictionary containing any additional data that will
be merged with the output dictionary.
A dictionary containing any additional data that will be merged with the output dictionary .