-
Notifications
You must be signed in to change notification settings - Fork 242
/
0_inference.sh
30 lines (23 loc) · 1007 Bytes
/
0_inference.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
#!/bin/bash
# ------ Inference audio tagging result with pretrained model. ------
MODEL_TYPE="Cnn14"
CHECKPOINT_PATH="Cnn14_mAP=0.431.pth"
# Download audio tagging checkpoint.
wget -O $CHECKPOINT_PATH "https://zenodo.org/record/3987831/files/Cnn14_mAP%3D0.431.pth?download=1"
# Inference.
python3 pytorch/inference.py audio_tagging \
--model_type=$MODEL_TYPE \
--checkpoint_path=$CHECKPOINT_PATH \
--audio_path="resources/R9_ZSCveAHg_7s.wav" \
--cuda
# ------ Inference sound event detection result with pretrained model. ------
MODEL_TYPE="Cnn14_DecisionLevelMax"
CHECKPOINT_PATH="Cnn14_DecisionLevelMax_mAP=0.385.pth"
# Download sound event detection checkpoint.
wget -O $CHECKPOINT_PATH "https://zenodo.org/record/3987831/files/Cnn14_DecisionLevelMax_mAP%3D0.385.pth?download=1"
# Inference.
python3 pytorch/inference.py sound_event_detection \
--model_type=$MODEL_TYPE \
--checkpoint_path=$CHECKPOINT_PATH \
--audio_path="resources/R9_ZSCveAHg_7s.wav" \
--cuda