-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
add augmentation part #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, but still needs intensive improvement.
Only reviewed for audio.py
before Line 398.
-
Please pay more attention to the details, especially for the docs. Remember an old saying "Devil is in the details! ".
-
Please avoid copying codes from somewhere without a fully understanding about it. It would be better if we could improve it, or at least make it cleaner. The same thing goes to docs.
-
Please add unit tests or at least test every function before commit. If the project is urgent, some delay for the unit test would be acceptable. But at least, every function must be tested by the author before commit. For the audio parts, the tests should also include writing the transformed audio into a wav file and then we listen to the wav file to make sure such transformation functions correctly. If we have time, a timely added unit test would be great!
@@ -6,6 +6,8 @@ | |||
import numpy as np | |||
import io | |||
import soundfile | |||
import scikits.samplerate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the package "scikits" and "scipy" to requirements.txt. Make sure they can be installed by pip install -r requirements.txt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
@@ -63,6 +65,69 @@ def from_file(cls, file): | |||
return cls(samples, sample_rate) | |||
|
|||
@classmethod | |||
def slice_from_file(cls, fname, start=None, end=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fname --> file
Please avoid using too many abbreviation if the full name is not too long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
@@ -63,6 +65,69 @@ def from_file(cls, file): | |||
return cls(samples, sample_rate) | |||
|
|||
@classmethod | |||
def slice_from_file(cls, fname, start=None, end=None): | |||
""" | |||
Loads a small section of an audio without having to load |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put Line 70 into Line 69.
The same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
Loads a small section of an audio without having to load | ||
the entire file into the memory which can be incredibly wasteful. | ||
|
||
:param fname: input audio file name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"input audio file name." --> "Input audio filepath."
Note the upper case and an ending dot mark.
The same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
:param fname: input audio file name | ||
:type fname: bsaestring | ||
:param start: start time in seconds (supported granularity is ms) | ||
If start is negative, it wraps around from the end. If not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Improper indent. Please make "If" align with "Start". The same below.
- Remove "(supported granularity is ms )".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
|
||
Note that this is an in-place transformation. | ||
|
||
:param new_sample_rate: target sample rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "new_sample_rate"? You have only "target_sample_rate"!
deep_speech_2/data_utils/audio.py
Outdated
raise NotImplementedError() | ||
"""Pads this audio sample with a period of silence. | ||
|
||
Note that this is an in-place transformation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be careful about the doc's coding style (Upper case, dot mark, proper indent), as mentioned above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
'beginning' - adds silence in the beginning | ||
'end' - adds silence in the end | ||
'both' - adds silence in both the beginning and the end. | ||
:type sides: basestring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, unicode is not possible. So basestring --> str. Use basestring Only when both unicode and str are supported.
deep_speech_2/data_utils/audio.py
Outdated
elif sides == "both": | ||
padded = cls.concatenate(silence, self, silence) | ||
else: | ||
raise ValueError("Unknown value for the kwarg 'sides'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--> raise ValueError("Unknown sides value %s." % sides)
deep_speech_2/data_utils/audio.py
Outdated
|
||
def subsegment(self, start_sec=None, end_sec=None): | ||
raise NotImplementedError() | ||
"""Return new AudioSegment containing audio between given boundaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc is different from the codes: not "return ....".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have rewrite the audio.py file to make it more formal. But there is still a problem, bayesias normalize not found in the speech_dl code related to the introduction. The part of the code will not affect other functions when delete it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested every function in audio.py,the unit test test script will be pushed later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs improvement.
deep_speech_2/data_utils/audio.py
Outdated
""" | ||
if type(self) != type(other): | ||
raise TypeError("Cannot add segment of different type: {}" | ||
.format(type(other))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-->raise TypeError("Cannot add segments of different types: %s and %s." % (type(self), type(other)))
As mentioned in last review, do not use two kinds of string formatting methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
@@ -44,6 +47,32 @@ def __ne__(self, other): | |||
"""Return whether two objects are unequal.""" | |||
return not self.__eq__(other) | |||
|
|||
def __len__(self): | |||
"""Returns length of segment in samples.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns --> Return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
@@ -75,6 +104,31 @@ def from_bytes(cls, bytes): | |||
io.BytesIO(bytes), dtype='float32') | |||
return cls(samples, sample_rate) | |||
|
|||
def concatenate(self, *segments): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it a classmethod:
@classmethod
def concatenate(cls, *segment):
Please also overload it for SpeechSegment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
if sample_rate != seg._sample_rate: | ||
raise ValueError("Can't concatenate segments with " | ||
"different sample rates") | ||
if type(seg) is not type(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type(self) --> cls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
raise TypeError("Only audio segments of the same type " | ||
"instance can be concatenated.") | ||
samples = np.concatenate([seg.samples for seg in segments]) | ||
return type(self)(samples, sample_rate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type(self) --> cls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
if noise.sample_rate != self.sample_rate: | ||
raise ValueError("Noise sample rate (%d Hz) is not equal to " | ||
"base signal sample rate (%d Hz)." % | ||
(noise.sample_rate, self.sample_rate)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert L483-L485 to two lines. The same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
"least as long as base signal (%f sec)." % | ||
(noise.duration, self.duration)) | ||
noise_gain_db = self.rms_db - noise.rms_db - snr_dB | ||
noise_gain_db = min(max_gain_db, noise_gain_db) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L490-491 --> `noise_gain_bd = min(self.rms_db - noise.rms_db - snr_dB, max_gain_bd)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
noise_gain_db = self.rms_db - noise.rms_db - snr_dB | ||
noise_gain_db = min(max_gain_db, noise_gain_db) | ||
noise_subsegment = noise.random_subsegment(self.duration, rng=rng) | ||
output = self + self.tranform_noise(noise_subsegment, noise_gain_db) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have def apply_gain(...)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
self._samples = output._samples | ||
self._sample_rate = output._sample_rate | ||
|
||
def tranform_noise(self, noise_subsegment, noise_gain_db): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this, use apply_gain
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
raise NotImplementedError() | ||
:param impulse_segment: Impulse response segments. | ||
:type impulse_segment: AudioSegment | ||
:param allow_resample: indicates whether resampling is allowed when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indicates --> Indicates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved the above mentioned problem
deep_speech_2/data_utils/audio.py
Outdated
|
||
def subsegment(self, start_sec=None, end_sec=None): | ||
raise NotImplementedError() | ||
"""Return new AudioSegment containing audio between given boundaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
@@ -44,6 +47,32 @@ def __ne__(self, other): | |||
"""Return whether two objects are unequal.""" | |||
return not self.__eq__(other) | |||
|
|||
def __len__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
@@ -44,6 +47,32 @@ def __ne__(self, other): | |||
"""Return whether two objects are unequal.""" | |||
return not self.__eq__(other) | |||
|
|||
def __len__(self): | |||
"""Returns length of segment in samples.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
"""Returns length of segment in samples.""" | ||
return self.num_samples | ||
|
||
def __add__(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
a new segment (sample-wise addition, not segment concatenation). | ||
|
||
:param other: Segment containing samples to be | ||
added in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
gain to a zero signal. | ||
:type max_gain_db: float | ||
:param rng: Random number generator state. | ||
:type rng: random.Random |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
if noise.sample_rate != self.sample_rate: | ||
raise ValueError("Noise sample rate (%d Hz) is not equal to " | ||
"base signal sample rate (%d Hz)." % | ||
(noise.sample_rate, self.sample_rate)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
"least as long as base signal (%f sec)." % | ||
(noise.duration, self.duration)) | ||
noise_gain_db = self.rms_db - noise.rms_db - snr_dB | ||
noise_gain_db = min(max_gain_db, noise_gain_db) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
noise_gain_db = self.rms_db - noise.rms_db - snr_dB | ||
noise_gain_db = min(max_gain_db, noise_gain_db) | ||
noise_subsegment = noise.random_subsegment(self.duration, rng=rng) | ||
output = self + self.tranform_noise(noise_subsegment, noise_gain_db) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/audio.py
Outdated
self._samples = output._samples | ||
self._sample_rate = output._sample_rate | ||
|
||
def tranform_noise(self, noise_subsegment, noise_gain_db): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost LGTM.
deep_speech_2/data_utils/audio.py
Outdated
:rtype: AudioSegment | ||
:raises ValueError: If the number of segments is zero, or if the | ||
sample_rate of any two segment does not match. | ||
:raises TypeError: If every item in segments is not AudioSegment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every item in segments --> any segment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
:return: Audio segment instance as concatenating results. | ||
:rtype: AudioSegment | ||
:raises ValueError: If the number of segments is zero, or if the | ||
sample_rate of any two segment does not match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two segment --> segments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
"different sample rates") | ||
if type(seg) is not cls: | ||
raise TypeError("Only audio segments of the same type " | ||
"instance can be concatenated.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "instance"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
@classmethod | ||
def make_silence(cls, duration, sample_rate): | ||
"""Creates a silent audio segment of the given duration and | ||
sample rate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is one line enough for the whole sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
samples = np.zeros(int(duration * sample_rate)) | ||
return cls(samples, sample_rate) | ||
|
||
def superimposed(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
superimposed --> superimpose ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
" base signal (%f sec)." % | ||
(noise.duration, self.duration)) | ||
noise_gain_db = min(self.rms_db - noise.rms_db - snr_dB, max_gain_db) | ||
noise.random_subsegment(self.duration, rng=rng) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add noise_new = copy.deepcopy(noise)
, and then perform transformation on noise_new
, otherwise the input noise
will be modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
@@ -65,6 +65,74 @@ def from_bytes(cls, bytes, transcript): | |||
audio = AudioSegment.from_bytes(bytes) | |||
return cls(audio.samples, audio.sample_rate, transcript) | |||
|
|||
@classmethod | |||
def concatenate(cls, *segments): | |||
"""Concatenate an arbitrary number of speech segments together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "Both audio and transcript will be concatenated."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
:rtype: SpeechSegment | ||
:raises ValueError: If the number of segments is zero, or if the | ||
sample_rate of any two segments does not match. | ||
:raises TypeError: If every item in segments is not SpeechSegment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every item in segments --> any segment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
@classmethod | ||
def make_silence(cls, duration, sample_rate): | ||
"""Creates a silent speech segment of the given duration and | ||
sample rate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "Transcript will be an empty string.".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
return cls(samples, sample_rate, transcripts) | ||
|
||
@classmethod | ||
def slice_from_file(cls, filepath, start=None, end=None, transcript=""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better for transcript
to have no default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix all problem
deep_speech_2/data_utils/audio.py
Outdated
:return: Audio segment instance as concatenating results. | ||
:rtype: AudioSegment | ||
:raises ValueError: If the number of segments is zero, or if the | ||
sample_rate of any two segment does not match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
:rtype: AudioSegment | ||
:raises ValueError: If the number of segments is zero, or if the | ||
sample_rate of any two segment does not match. | ||
:raises TypeError: If every item in segments is not AudioSegment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
"different sample rates") | ||
if type(seg) is not cls: | ||
raise TypeError("Only audio segments of the same type " | ||
"instance can be concatenated.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
@classmethod | ||
def make_silence(cls, duration, sample_rate): | ||
"""Creates a silent audio segment of the given duration and | ||
sample rate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
samples = np.zeros(int(duration * sample_rate)) | ||
return cls(samples, sample_rate) | ||
|
||
def superimposed(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
deep_speech_2/data_utils/audio.py
Outdated
" base signal (%f sec)." % | ||
(noise.duration, self.duration)) | ||
noise_gain_db = min(self.rms_db - noise.rms_db - snr_dB, max_gain_db) | ||
noise.random_subsegment(self.duration, rng=rng) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
@@ -65,6 +65,74 @@ def from_bytes(cls, bytes, transcript): | |||
audio = AudioSegment.from_bytes(bytes) | |||
return cls(audio.samples, audio.sample_rate, transcript) | |||
|
|||
@classmethod | |||
def concatenate(cls, *segments): | |||
"""Concatenate an arbitrary number of speech segments together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
:rtype: SpeechSegment | ||
:raises ValueError: If the number of segments is zero, or if the | ||
sample_rate of any two segments does not match. | ||
:raises TypeError: If every item in segments is not SpeechSegment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
return cls(samples, sample_rate, transcripts) | ||
|
||
@classmethod | ||
def slice_from_file(cls, filepath, start=None, end=None, transcript=""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
deep_speech_2/data_utils/speech.py
Outdated
@classmethod | ||
def make_silence(cls, duration, sample_rate): | ||
"""Creates a silent speech segment of the given duration and | ||
sample rate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
resolve #96
noise_speech
,impuls_response
,resampler
,speed_perturb
,online_bayesias_normalization
.convolve
,add_noise
,normalizer