Beispiel #1
0
    def __str__(self):
        ui = FancyStringifier()
        output = ''
        output += FancyStringifier().class_name(self.__class__.__name__) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += FancyStringifier().data(field='filename',
                                              value=self.filename) + '\n'

        output += ui.data(field='fs', value=self.fs) + '\n'
        output += ui.line(field='Frame blocking') + '\n'
        output += ui.data(indent=4,
                          field='hop_length_samples',
                          value=self.hop_length_samples) + '\n'
        output += ui.data(indent=4,
                          field='hop_length_seconds',
                          value=self.hop_length_seconds,
                          unit='sec') + '\n'

        output += ui.data(indent=4,
                          field='win_length_samples',
                          value=self.win_length_samples) + '\n'
        output += ui.data(indent=4,
                          field='win_length_seconds',
                          value=self.win_length_seconds,
                          unit='sec') + '\n'

        return output
Beispiel #2
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indention used
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = super(FileLock, self).to_string(ui=ui, indent=indent)

        output += ui.data(field='main_filename',
                          value=self.main_filename,
                          indent=indent) + '\n'
        output += ui.data(field='lock_filename',
                          value=self.lock_filename,
                          indent=indent) + '\n'
        output += ui.data(
            field='timeout', value=self.timeout, unit='sec',
            indent=indent) + '\n'

        return output
Beispiel #3
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indention used
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = super(Aggregator, self).to_string(ui=ui, indent=indent)

        output += ui.data(field='win_length_frames',
                          value=self.win_length_frames,
                          indent=indent) + '\n'
        output += ui.data(field='hop_length_frames',
                          value=self.hop_length_frames,
                          indent=indent) + '\n'
        output += ui.data(field='recipe', value=self.recipe,
                          indent=indent) + '\n'

        return output
Beispiel #4
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indention used
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = super(Normalizer, self).to_string(ui=ui, indent=indent)

        output += ui.data(field='Mean', value=self.mean, indent=indent) + '\n'
        output += ui.data(field='Std', value=self.std, indent=indent) + '\n'

        output += ui.data(field='n', value=self.n, indent=indent) + '\n'

        return output
Beispiel #5
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indent
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = ''
        output += ui.class_name(self.__class__.__name__, indent=indent) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += ui.data(field='filename', value=self.filename) + '\n'

        for item_id, item in enumerate(self):
            output += ui.line(field='[' + str(item_id) + ']', indent=indent) + '\n'
            output += DictContainer(item).to_string(ui=ui, indent=indent + 1) + '\n'

        return output
Beispiel #6
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indent
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = ''
        output += ui.class_name(self.__class__.__name__, indent=indent) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += ui.data(
                field='filename', value=self.filename, indent=indent) + '\n'

        return output
Beispiel #7
0
    def __str__(self):
        ui = FancyStringifier()

        output = super(Stacker, self).__str__()
        output += ui.data(field='recipe', value=self.recipe) + '\n'
        output += ui.data(field='hop', value=self.hop) + '\n'

        return output
Beispiel #8
0
    def __str__(self):
        ui = FancyStringifier()
        output = super(RMSEnergyExtractor, self).__str__()

        output += ui.line(field='RMSEnergy') + '\n'
        output += ui.data(indent=4, field='center', value=self.center) + '\n'

        return output
Beispiel #9
0
    def __str__(self):
        ui = FancyStringifier()
        output = super(ZeroCrossingRateExtractor, self).__str__()

        output += ui.line(field='ZCR') + '\n'
        output += ui.data(indent=4, field='center', value=self.center) + '\n'

        return output
Beispiel #10
0
    def __str__(self):
        ui = FancyStringifier()
        output = super(MfccDeltaExtractor, self).__str__()

        output += ui.line(field='Delta') + '\n'
        output += ui.data(indent=4, field='width', value=self.width) + '\n'

        return output
Beispiel #11
0
    def __str__(self):
        ui = FancyStringifier()
        output = super(SpectralCentroidExtractor, self).__str__()

        output += ui.line(field='SpectralCentroid') + '\n'
        output += ui.data(indent=4, field='center', value=self.center) + '\n'

        return output
Beispiel #12
0
    def __str__(self):
        output = ''
        output += FancyStringifier().class_name(self.__class__.__name__) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += FancyStringifier().data(field='filename',
                                              value=self.filename) + '\n'

        return output
Beispiel #13
0
    def __str__(self):
        ui = FancyStringifier()
        output = super(Aggregator, self).__str__()
        output += ui.data(field='win_length_frames',
                          value=self.win_length_frames) + '\n'
        output += ui.data(field='hop_length_frames',
                          value=self.hop_length_frames) + '\n'
        output += ui.data(field='recipe', value=self.recipe) + '\n'

        return output
Beispiel #14
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indention used
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = ''
        output += ui.class_name(self.__class__.__name__, indent=indent) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += ui.data(
                field='filename', value=self.filename, indent=indent) + '\n'

        if self._file_info is None:
            self.get_info()

        output += ui.line('Size', indent=indent) + '\n'

        output += ui.data(field='Uncompressed',
                          value=get_byte_string(self._size_uncompressed),
                          indent=indent + 2) + '\n'

        if self.format == FileFormat.ZIP:
            output += ui.data(field='Compressed',
                              value=get_byte_string(self._size_compressed),
                              indent=indent + 2) + '\n'

            output += ui.data(field='Ratio',
                              value=self._size_compressed /
                              float(self._size_uncompressed) * 100,
                              unit='%',
                              indent=indent + 2) + '\n'

        output += ui.line('Files', indent=indent) + '\n'
        output += ui.data(field='Count',
                          value=len(self._file_info),
                          indent=indent + 2) + '\n'

        return output
Beispiel #15
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indention used
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = super(Sequencer, self).to_string(ui=ui, indent=indent)

        output += ui.data(field='frames', value=self.sequence_length, indent=indent) + '\n'
        output += ui.data(field='hop_length_frames', value=self.hop_length, indent=indent) + '\n'
        output += ui.data(field='padding', value=self.padding, indent=indent) + '\n'
        output += ui.data(field='required_data_amount_per_segment', value=self.required_data_amount_per_segment, indent=indent) + '\n'
        output += ui.line(field='Shifting', indent=indent) + '\n'
        output += ui.data(indent=indent + 2, field='shift', value=self.shift) + '\n'
        output += ui.data(indent=indent + 2, field='shift_border', value=self.shift_border) + '\n'

        return output
Beispiel #16
0
    def __str__(self):
        ui = FancyStringifier()

        output = super(Normalizer, self).__str__()

        output += ui.data(field='Mean', value=self.mean) + '\n'
        output += ui.data(field='Std', value=self.std) + '\n'

        output += ui.data(field='n', value=self.n) + '\n'

        return output
Beispiel #17
0
    def __str__(self):
        output = ''
        output += FancyStringifier().class_name(self.__class__.__name__) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += FancyStringifier().data(field='filename',
                                              value=self.filename) + '\n'

        for item_id, item in enumerate(self):
            output += '[' + str(item_id) + ']' + '  ' + str(item) + '\n'

        return output
Beispiel #18
0
    def __str__(self):
        ui = FancyStringifier()

        output = super(FileLock, self).__str__()

        output += ui.data(field='main_filename',
                          value=self.main_filename) + '\n'
        output += ui.data(field='lock_filename',
                          value=self.lock_filename) + '\n'
        output += ui.data(field='timeout', value=self.timeout,
                          unit='sec') + '\n'

        return output
Beispiel #19
0
    def __str__(self):
        ui = FancyStringifier()

        output = ''
        output += FancyStringifier().class_name(self.__class__.__name__) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += FancyStringifier().data(field='filename',
                                              value=self.filename) + '\n'

        for item_id, item in enumerate(self):
            output += ui.line('[' + str(item_id) + ']', indent=0) + '\n'
            output += ui.line(str(DictContainer(item)), indent=3) + '\n'

        return output
Beispiel #20
0
    def to_string(self, ui=None, indent=0):
        """Get information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indent
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = ''
        output += ui.class_name(self.__class__.__name__, indent=indent) + '\n'
        output += ui.data(field='Best model weights at epoch', value=self.best_model_epoch, indent=indent) + '\n'
        output += ui.data(field='Metric type', value=self.monitor, indent=indent+2) + '\n'
        output += ui.data(field='Metric value', value=self.best, indent=indent+2) + '\n'
        output += ui.line()

        return output
Beispiel #21
0
    def __str__(self):
        ui = FancyStringifier()

        output = super(Sequencer, self).__str__()
        output += ui.data(field='frames', value=self.frames) + '\n'
        output += ui.data(field='hop_length_frames',
                          value=self.hop_length_frames) + '\n'
        output += ui.data(field='padding', value=self.padding) + '\n'
        output += ui.data(field='required_data_amount_per_segment',
                          value=self.required_data_amount_per_segment) + '\n'
        output += ui.line(field='Shifting') + '\n'
        output += ui.data(indent=4, field='shift', value=self.shift) + '\n'
        output += ui.data(
            indent=4, field='shift_border', value=self.shift_border) + '\n'

        return output
Beispiel #22
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indention used
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = super(RepositoryNormalizer, self).to_string(ui=ui, indent=indent)

        output += ui.data(
            indent=indent + 2,
            field='Labels',
            value=list(self.normalizers.keys())
        ) + '\n'

        output += ui.line(field='Content') + '\n'
        for label, label_data in iteritems(self.normalizers):
            if label_data:
                output += ui.data(
                    indent=indent + 2,
                    field='['+str(label)+']',
                    value=label_data
                ) + '\n'

        output += '\n'
        return output
Beispiel #23
0
    def chain_string(self):
        """Basic info about the items in the chain.

        Returns
        -------
        str

        """

        output = ''

        ui = FancyStringifier()
        output += ui.row('ID',
                         'Processor',
                         'Input',
                         'Output',
                         'Init parameters set',
                         widths=[5, 30, 18, 18, 50]) + '\n'
        output += ui.row('-', '-', '-', '-', '-') + '\n'
        if len(self):
            for item_id, item in enumerate(self):
                if isinstance(item, ProcessingChainItem):
                    current_processor = self.processor_class_reference(
                        processor_name=item['processor_name'])
                    processor_name = item['processor_name'].split('.')[-1]

                    output += ui.row(
                        item_id, processor_name, current_processor.input_type,
                        current_processor.output_type, ','.join(
                            item.get('init_parameters', {}).keys())) + '\n'

        else:
            output += ui.row('Empty', widths=[95])

        return output
Beispiel #24
0
    def chain_string(self):
        """Basic info about the items in the chain.

        Returns
        -------
        str

        """

        output = ''

        ui = FancyStringifier()
        output += ui.row('ID',
                         'Processor',
                         'INPUT',
                         'OUTPUT',
                         'INIT',
                         widths=[5, 52, 18, 18, 25]) + '\n'
        output += ui.row('-', '-', '-', '-', '-') + '\n'
        if len(self):
            for item_id, item in enumerate(self):
                if isinstance(item, ProcessingChainItem):
                    current_processor = self.processor_class_reference(
                        processor_name=item['processor_name'])

                    output += ui.row(item_id, item['processor_name'],
                                     current_processor.input_type,
                                     current_processor.output_type,
                                     item.get('init_parameters')) + '\n'

        else:
            output += ui.row('Empty', widths=[95])

        return output
Beispiel #25
0
    def __str__(self):
        ui = FancyStringifier()
        output = ui.class_name(self.__class__.__name__) + '\n'
        output += ui.line(field='Meta') + '\n'
        if self.filename:
            output += ui.data(indent=4, field='filename',
                              value=self.filename) + '\n'

        if self.label:
            output += ui.data(indent=4, field='label', value=self.label) + '\n'

        if self.probability is not None:
            output += ui.data(
                indent=4, field='probability', value=self.probability) + '\n'

        output += ui.line(field='Item') + '\n'
        output += ui.data(indent=4, field='id', value=self.id) + '\n'
        return output
Beispiel #26
0
    def __str__(self):
        ui = FancyStringifier()
        output = super(MfccStaticExtractor, self).__str__()

        output += ui.line(field='MFCC') + '\n'
        output += ui.data(indent=4, field='n_mels', value=self.n_mels) + '\n'
        output += ui.data(indent=4, field='fmin', value=self.fmin) + '\n'
        output += ui.data(indent=4, field='fmax', value=self.fmax) + '\n'
        output += ui.data(indent=4,
                          field='normalize_mel_bands',
                          value=self.normalize_mel_bands) + '\n'
        output += ui.data(indent=4, field='htk', value=self.htk) + '\n'
        output += ui.data(indent=4, field='n_mfcc', value=self.n_mfcc) + '\n'

        return output
Beispiel #27
0
    def __str__(self):
        ui = FancyStringifier()

        output = ''
        output += FancyStringifier().class_name(self.__class__.__name__) + '\n'

        if hasattr(self, 'filename') and self.filename:
            output += FancyStringifier().data(field='filename',
                                              value=self.filename) + '\n'

        if self._file_info is None:
            self.get_info()

        output += ui.line('Size', indent=2) + '\n'

        output += FancyStringifier().data(field='Uncompressed',
                                          value=get_byte_string(
                                              self._size_uncompressed),
                                          indent=4) + '\n'

        if self.format == FileFormat.ZIP:
            output += FancyStringifier().data(field='Compressed',
                                              value=get_byte_string(
                                                  self._size_compressed),
                                              indent=4) + '\n'

            output += FancyStringifier().data(
                field='Ratio',
                value=self._size_compressed / float(self._size_uncompressed) *
                100,
                unit='%',
                indent=4) + '\n'

        output += ui.line('Files', indent=2) + '\n'
        output += FancyStringifier().data(
            field='Count', value=len(self._file_info), indent=4) + '\n'

        return output
Beispiel #28
0
    def to_string(self, ui=None, indent=0):
        """Get container information in a string

        Parameters
        ----------
        ui : FancyStringifier or FancyHTMLStringifier
            Stringifier class
            Default value FancyStringifier

        indent : int
            Amount of indent
            Default value 0

        Returns
        -------
        str

        """

        if ui is None:
            ui = FancyStringifier()

        output = ''
        output += ui.class_name(self.__class__.__name__, indent=indent) + '\n'
        output += ui.line(field='Meta', indent=indent) + '\n'
        if self.filename:
            output += ui.data(indent=indent + 2,
                              field='filename',
                              value=self.filename) + '\n'

        if self.label:
            output += ui.data(
                indent=indent + 2, field='label', value=self.label) + '\n'

        if self.probability is not None:
            output += ui.data(indent=indent + 2,
                              field='probability',
                              value=self.probability) + '\n'

        output += ui.line(field='Item', indent=indent) + '\n'
        output += ui.data(indent=indent + 2, field='id', value=self.id) + '\n'
        return output
Beispiel #29
0
    def __str__(self):
        ui = FancyStringifier()
        output = super(HHTFeatureExtractor, self).__str__()

        output += ui.data(indent=4, field='n_imf', value=self.n_imf) + '\n'
        output += ui.line(field='Spectrogram') + '\n'
        output += ui.data(indent=4,
                          field='spectrogram_type',
                          value=self.spectrogram_type) + '\n'
        output += ui.data(indent=4, field='n_hht', value=self.n_hht) + '\n'
        output += ui.data(
            indent=4, field='window_type', value=self.window_type) + '\n'

        return output
Beispiel #30
0
    def __str__(self):
        ui = FancyStringifier()

        output = super(DataBuffer, self).__str__()

        output += ui.data(field='size', value=self.size) + '\n'
        output += ui.data(field='index', value=self.index) + '\n'
        output += ui.line(field='Buffer') + '\n'
        output += ui.data(indent=4, field='data_buffer', value=self.data_buffer) + '\n'
        output += ui.data(indent=4, field='meta_buffer', value=self.meta_buffer) + '\n'

        return output