-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare_data.sh
More file actions
executable file
·71 lines (58 loc) · 1.96 KB
/
prepare_data.sh
File metadata and controls
executable file
·71 lines (58 loc) · 1.96 KB
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
#!/usr/bin/env bash
#
# Copyright (c) 2018, Curious AI Ltd. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
# echo "Downloading SVHN"
# mkdir -p data/images/svhn
# (
# cd data/images/svhn
# curl -O 'http://ufldl.stanford.edu/housenumbers/{train,test,extra}_32x32.mat'
# )
# echo
# echo "Downloading CIFAR-10"
# mkdir -p data/images/cifar/cifar10
# (
# cd data/images/cifar/cifar10
# curl -O 'https://www.cs.toronto.edu/~kriz/cifar-10-matlab.tar.gz'
# tar xvzf cifar-10-matlab.tar.gz
# mv cifar-10-batches-mat/* .
# rmdir cifar-10-batches-mat
# )
# echo
# echo "Preprocessing CIFAR-10"
# python prepare_data/preprocess_cifar10.py
# echo
# echo "All done!"
echo "Preparing google audio datasets"
mkdir -p data/images/audio/download/speech_commands
(
cd data/images/audio/download
wget -O speech_commands_v0.01.tar.gz "http://download.tensorflow.org/data/speech_commands_v0.01.tar.gz"
tar -xvzf speech_commands_v0.01.tar.gz -C ./speech_commands_v0.01/
)
echo "google command datasets downloaded and unziped"
echo "convert wav format to png format"
python prepare_data/audio2img_google.py
echo "Preprocessing audio"
python prepare_data/preprocess_audio30.py
cd ../../../../
echo "Preparing urban datasets"
mkdir -p data/images/audio/download
(
mv urban-sound-classification data/images/audio/download
cd data/images/audio/download
unzip urban-sound-classification.zip -d urban-sound-classification
cd urban-sound-classification
unzip train.zip
# unzip test.zip
)
echo "urban dataset downloaded and unziped"
echo "convert wav format to png format"
python prepare_data/audio2img_urban.py
echo "Preprocessing audio"
python prepare_data/preprocess_urban.py
echo "All done!"