dataset stretch now optional
This commit is contained in:
parent
2c4d903fa2
commit
d929149a15
@ -9,6 +9,8 @@ class Speed(object):
|
||||
self.max_ratio = max_ratio
|
||||
|
||||
def __call__(self, x):
|
||||
if not all([self.speed_factor, self.max_ratio]):
|
||||
return x
|
||||
start = int(np.random.randint(0, x.shape[-1],1))
|
||||
end = int((np.random.uniform(0, self.max_ratio, 1) * x.shape[-1]) + start)
|
||||
end = min(end, x.shape[-1])
|
||||
|
Loading…
x
Reference in New Issue
Block a user