-
Notifications
You must be signed in to change notification settings - Fork 3
/
dcase_setup.sh
executable file
·67 lines (48 loc) · 2.4 KB
/
dcase_setup.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
#!/bin/bash
download_and_unzip() {
local file_url="$1"
local target_folder="$2"
# Extract the filename from the URL
local filename=$(basename "${file_url%%\?*}")
# Full path to the downloaded file
local file_path="$target_folder/$filename"
# Download the file
wget -O "$file_path" "$file_url"
# Check if the file is a zip file
if file --mime-type "$file_path" | grep -q zip$; then
echo "File is a zip. Unzipping..."
unzip "$file_path" -d "$target_folder"
echo "Deleting zip file..."
rm "$file_path"
fi
}
BASE_FOLDER=$1
TARGET_FOLDER=$BASE_FOLDER/DCASE
mkdir -p $TARGET_FOLDER
############################
# Download the BEATs model #
############################
MODEL_FOLDER=$BASE_FOLDER/model/BEATs
mkdir -p $MODEL_FOLDER
wget -O "$MODEL_FOLDER/BEATs_iter3_plus_AS2M.pt" "https://valle.blob.core.windows.net/share/BEATs/BEATs_iter3_plus_AS2M.pt?sv=2020-08-04&st=2023-03-01T07%3A51%3A05Z&se=2033-03-02T07%3A51%3A00Z&sr=c&sp=rl&sig=QJXmSJG9DbMKf48UDIU1MfzIro8HQOf3sqlNXiflY1I%3D"
#############################################################
# Download the development set (i.e. training + validation) #
#############################################################
# .csv
download_and_unzip "https://zenodo.org/records/10829604/files/DCASE2024_task5_training_set_classes.csv?download=1" "$TARGET_FOLDER"
download_and_unzip "https://zenodo.org/records/10829604/files/DCASE2024_task5_validation_set_classes.csv?download=1" "$TARGET_FOLDER"
# Annotations
download_and_unzip "https://zenodo.org/records/10829604/files/Development_set_annotations.zip?download=1" "$TARGET_FOLDER"
# Acoustic data
download_and_unzip "https://zenodo.org/records/10829604/files/Development_set.zip?download=1" "$TARGET_FOLDER"
#####################################################################
# Download the evaluation set - OUTDATED AS THIS WAS FOR DCASE 2023 #
#####################################################################
#mkdir -p "$TARGET_FOLDER/Development_Set/Evaluation_Set"
#download_and_unzip "https://zenodo.org/record/7879692/files/Annotations_only.zip?download=1" "$TARGET_FOLDER"
#mv "$TARGET_FOLDER/Annotations_only" "$TARGET_FOLDER/Development_Set_annotations/Evaluation_Set"
# Acoustic data
#for i in {1..3}
#do
# download_and_unzip "https://zenodo.org/record/7879692/files/eval_$i.zip?download=1" "$TARGET_FOLDER/Development_Set/Evaluation_Set"
#done