Spaces:
Sleeping
Sleeping
update
Browse files
examples/vm_sound_classification/run.sh
CHANGED
@@ -15,7 +15,7 @@ E:/Users/tianx/HuggingDatasets/vm_sound_classification/data/wav_finished/id-ID/w
|
|
15 |
sh run.sh --stage 2 --stop_stage 2 --system_version windows --file_folder_name file_dir --final_model_name vm_sound_classification3 --label_plan 4
|
16 |
sh run.sh --stage 3 --stop_stage 3 --system_version windows --file_folder_name file_dir --final_model_name vm_sound_classification3 --label_plan 4
|
17 |
|
18 |
-
sh run.sh --stage
|
19 |
--filename_patterns "/data/tianxing/PycharmProjects/datasets/voicemail/*/wav_finished/*/*.wav" --label_plan 4
|
20 |
|
21 |
"
|
|
|
15 |
sh run.sh --stage 2 --stop_stage 2 --system_version windows --file_folder_name file_dir --final_model_name vm_sound_classification3 --label_plan 4
|
16 |
sh run.sh --stage 3 --stop_stage 3 --system_version windows --file_folder_name file_dir --final_model_name vm_sound_classification3 --label_plan 4
|
17 |
|
18 |
+
sh run.sh --stage 4 --stop_stage 6 --system_version centos --file_folder_name file_dir --final_model_name vm_sound_classification4-ch16 \
|
19 |
--filename_patterns "/data/tianxing/PycharmProjects/datasets/voicemail/*/wav_finished/*/*.wav" --label_plan 4
|
20 |
|
21 |
"
|
toolbox/torchaudio/augment/spec_augment.py
CHANGED
@@ -8,6 +8,7 @@ from typing import List, Tuple
|
|
8 |
|
9 |
import torch
|
10 |
import torch.nn as nn
|
|
|
11 |
|
12 |
|
13 |
class SpecAugment(nn.Module):
|
@@ -19,8 +20,8 @@ class SpecAugment(nn.Module):
|
|
19 |
|
20 |
@staticmethod
|
21 |
def augment_volume(spec: torch.Tensor, factor_range: Tuple[float, float] = (0.5, 2.0)):
|
22 |
-
factor =
|
23 |
-
factor =
|
24 |
spec_ = spec.clone().detach()
|
25 |
spec_ *= factor
|
26 |
return spec_
|
|
|
8 |
|
9 |
import torch
|
10 |
import torch.nn as nn
|
11 |
+
from torch.distributions import uniform
|
12 |
|
13 |
|
14 |
class SpecAugment(nn.Module):
|
|
|
20 |
|
21 |
@staticmethod
|
22 |
def augment_volume(spec: torch.Tensor, factor_range: Tuple[float, float] = (0.5, 2.0)):
|
23 |
+
factor = uniform.Uniform(*factor_range)
|
24 |
+
factor = factor.sample()
|
25 |
spec_ = spec.clone().detach()
|
26 |
spec_ *= factor
|
27 |
return spec_
|