asahi417 commited on
Commit
e92b7b0
·
1 Parent(s): c4ab433
Files changed (2) hide show
  1. download_audio.py +1 -0
  2. main.sh +10 -62
download_audio.py CHANGED
@@ -126,6 +126,7 @@ def get_audio(dataframe: pd.DataFrame):
126
  print(f"wav shape:{wav.shape}")
127
  if wav.ndim > 1:
128
  wav = wav[:, 0]
 
129
  if sr != sampling_rate:
130
  print(f"RESAMPLING: {wav.shape} length audio")
131
  if torch.cuda.is_available():
 
126
  print(f"wav shape:{wav.shape}")
127
  if wav.ndim > 1:
128
  wav = wav[:, 0]
129
+ wav = wav[:int(end/sampling_rate * sr) + sr]
130
  if sr != sampling_rate:
131
  print(f"RESAMPLING: {wav.shape} length audio")
132
  if torch.cuda.is_available():
main.sh CHANGED
@@ -30,6 +30,8 @@ export LINE_NO_END=$((DATASET_ID * 2500))
30
  echo ${LINE_NO_START}
31
  python download_audio.py
32
 
 
 
33
  export N_POOL=10
34
  export DATASET_ID=2
35
  export DIRECTION="enA-jaA"
@@ -38,6 +40,8 @@ export LINE_NO_END=$((DATASET_ID * 2500))
38
  echo ${LINE_NO_START}
39
  python download_audio.py
40
 
 
 
41
  export N_POOL=10
42
  export DATASET_ID=10
43
  export DIRECTION="enA-jaA"
@@ -46,86 +50,30 @@ export LINE_NO_END=$((DATASET_ID * 2500))
46
  echo ${LINE_NO_START}
47
  python download_audio.py
48
 
49
- for i in $(seq 1 10);
50
- do
51
- export DATASET_ID=${i}
52
- export DIRECTION="enA-jaA"
53
- export LINE_NO_START=$(((DATASET_ID-1) * 2500))
54
- export LINE_NO_END=$((DATASET_ID * 2500))
55
- echo ${LINE_NO_START}
56
- python download_audio.py &
57
- done
58
 
59
- export DATASET_ID=11
60
- export DIRECTION="enA-jaA"
61
- export LINE_NO_START=$(((DATASET_ID-1) * 2500))
62
- export LINE_NO_END=$((DATASET_ID * 2500))
63
- echo ${LINE_NO_START}
64
- python download_audio.py
65
 
66
- for i in $(seq 11 20);
67
- do
68
- export DATASET_ID=${i}
69
- export DIRECTION="enA-jaA"
70
- export LINE_NO_START=$(((DATASET_ID-1) * 2500))
71
- export LINE_NO_END=$((DATASET_ID * 2500))
72
- echo ${LINE_NO_START}
73
- python download_audio.py &
74
- done
75
 
76
 
77
- for i in $(seq 21 30);
78
- do
79
- export N_POOL=50
80
- export DATASET_ID=${i}
81
- export DIRECTION="enA-jaA"
82
- export LINE_NO_START=$(((DATASET_ID-1) * 2500))
83
- export LINE_NO_END=$((DATASET_ID * 2500))
84
- echo ${LINE_NO_START}
85
- python download_audio.py
86
- done
87
-
88
- for i in $(seq 31 40);
89
- do
90
- export DATASET_ID=${i}
91
- export DIRECTION="enA-jaA"
92
- export LINE_NO_START=$(((DATASET_ID-1) * 2500))
93
- export LINE_NO_END=$((DATASET_ID * 2500))
94
- echo ${LINE_NO_START}
95
- python download_audio.py &
96
- done
97
-
98
- # kotoba-4
99
- for i in $(seq 41 50);
100
- do
101
- export N_POOL=10
102
- export DATASET_ID=${i}
103
- export DIRECTION="enA-jaA"
104
- export LINE_NO_START=$(((DATASET_ID-1) * 2500))
105
- export LINE_NO_END=$((DATASET_ID * 2500))
106
- echo ${LINE_NO_START}
107
- python download_audio.py
108
- done
109
-
110
  export CUDA_VISIBLE_DEVICES=
111
  export N_POOL=1
112
- export DATASET_ID=42
113
  export DIRECTION="enA-jaA"
114
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
115
  export LINE_NO_END=$((DATASET_ID * 2500))
116
  echo ${LINE_NO_START}
117
  python download_audio.py
118
 
119
-
120
- export N_POOL=10
121
- export DATASET_ID=41
122
  export DIRECTION="enA-jaA"
123
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
124
  export LINE_NO_END=$((DATASET_ID * 2500))
125
  echo ${LINE_NO_START}
126
  python download_audio.py
127
 
128
- export N_POOL=10
 
129
  export DATASET_ID=51
130
  export DIRECTION="enA-jaA"
131
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
 
30
  echo ${LINE_NO_START}
31
  python download_audio.py
32
 
33
+
34
+ export CUDA_VISIBLE_DEVICES=0
35
  export N_POOL=10
36
  export DATASET_ID=2
37
  export DIRECTION="enA-jaA"
 
40
  echo ${LINE_NO_START}
41
  python download_audio.py
42
 
43
+
44
+ export CUDA_VISIBLE_DEVICES=1
45
  export N_POOL=10
46
  export DATASET_ID=10
47
  export DIRECTION="enA-jaA"
 
50
  echo ${LINE_NO_START}
51
  python download_audio.py
52
 
 
 
 
 
 
 
 
 
 
53
 
 
 
 
 
 
 
54
 
 
 
 
 
 
 
 
 
 
55
 
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  export CUDA_VISIBLE_DEVICES=
58
  export N_POOL=1
59
+ export DATASET_ID=41
60
  export DIRECTION="enA-jaA"
61
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
62
  export LINE_NO_END=$((DATASET_ID * 2500))
63
  echo ${LINE_NO_START}
64
  python download_audio.py
65
 
66
+ export CUDA_VISIBLE_DEVICES=0
67
+ export N_POOL=20
68
+ export DATASET_ID=42
69
  export DIRECTION="enA-jaA"
70
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))
71
  export LINE_NO_END=$((DATASET_ID * 2500))
72
  echo ${LINE_NO_START}
73
  python download_audio.py
74
 
75
+ export CUDA_VISIBLE_DEVICES=0
76
+ export N_POOL=20
77
  export DATASET_ID=51
78
  export DIRECTION="enA-jaA"
79
  export LINE_NO_START=$(((DATASET_ID-1) * 2500))