-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.sh
197 lines (156 loc) · 4.08 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!/bin/bash
# #################### get env directories
# CONDA_ROOT
CONDA_NEW_ENV=pytorch_py3
sudo apt-get update
sudo apt-get install -y apt-utils
sudo apt-get install -y libsndfile1-dev ffmpeg
source activate ${CONDA_NEW_ENV}
pip install -r requirement.txt
DATASET="../../algo-2021/dataset/tagging/"
if [ -z "$1" ]; then
echo "[Warning] TYPE is not set, using '../../algo-2021/dataset/tagging/' as default"
else
DATASET=$(echo "$1" | tr '[:upper:]' '[:lower:]')
echo "[Info] DATASET is ${DATASET}"
fi
dir="../dataset/train/frame"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/train/text_txt"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/train/audio_npy"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/train/raw_video"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/train/video_npy/vit"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/train/video_npy/efficient"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
# 复制文本
text_dir="tagging_dataset_train_5k/text_txt/tagging/"
text_name="tagging_dataset_train_5k/text_txt/tagging/*"
source_dir=$DATASET$text_dir
target_dir="../dataset/train/text_txt/"
if [ -d $source_dir ];then
echo "文本数据集路径正确"
else
echo "文本数据集路径错误"
exit 0
fi
source_dir=$DATASET$text_name
cp $source_dir $target_dir
echo "复制文本数据成功"
# 复制音频
audio_dir="tagging_dataset_train_5k/audio_npy/Vggish/tagging/"
audio_name="tagging_dataset_train_5k/audio_npy/Vggish/tagging/*"
source_dir=$DATASET$audio_dir
target_dir="../dataset/train/audio_npy/"
if [ -d $source_dir ];then
echo "音频数据集路径正确"
else
echo "音频数据集路径错误"
exit 0
fi
source_dir=$DATASET$audio_name
cp $source_dir $target_dir
echo "复制音频数据成功"
dir="../dataset/test_2nd/frame"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/test_2nd/text_txt"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/test_2nd/audio_npy"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/test_2nd/raw_video"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/test_2nd/video_npy/vit"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
dir="../dataset/test_2nd/video_npy/efficient"
if [ ! -d "$dir" ];then
mkdir -p $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
# 复制文本
text_dir="tagging_dataset_test_5k_2nd/text_txt/tagging/"
text_name="tagging_dataset_test_5k_2nd/text_txt/tagging/*"
target_dir="../dataset/test_2nd/text_txt/"
source_dir=$DATASET$text_dir
if [ -d $source_dir ];then
echo "测试集文本数据集路径正确"
else
echo "测试集文本数据集路径错误"
exit 0
fi
source_dir=$DATASET$text_name
cp $source_dir $target_dir
echo "复制测试集文本数据集成功"
# 复制音频
audio_dir="tagging_dataset_test_5k_2nd/audio_npy/Vggish/tagging/"
audio_name="tagging_dataset_test_5k_2nd/audio_npy/Vggish/tagging/*"
source_dir=$DATASET$audio_dir
target_dir="../dataset/test_2nd/audio_npy/"
if [ -d $source_dir ];then
echo "测试集音频数据集路径正确"
else
echo "测试集音频数据集路径错误"
exit 0
fi
source_dir=$DATASET$audio_name
cp $source_dir $target_dir
echo "复制数据集成功"