Update README.md
Browse files
README.md
CHANGED
@@ -66,13 +66,17 @@ Output:
|
|
66 |
|
67 |
## Inference: get logits and probabilities
|
68 |
|
|
|
|
|
69 |
```python
|
70 |
sample_rate = 32000
|
71 |
audio_target_length = 10 * sample_rate # 10 s
|
72 |
|
73 |
# AUDIO_FNAME = "f62-S-v2swA_200000_210000.wav"
|
74 |
AUDIO_FNAME = "254906__tpellegrini__cavaco1.wav"
|
75 |
-
|
|
|
|
|
76 |
|
77 |
waveform, sample_rate_ = torchaudio.load(AUDIO_FPATH)
|
78 |
if sample_rate_ != sample_rate:
|
@@ -107,7 +111,6 @@ probs = output["clipwise_output"]
|
|
107 |
# Equivalent: probs = torch.sigmoid(logits)
|
108 |
print("probs size:", probs.size())
|
109 |
|
110 |
-
current_dir=os.getcwd()
|
111 |
lb_to_ix, ix_to_lb, id_to_ix, ix_to_id = read_audioset_label_tags(os.path.join(current_dir, "class_labels_indices.csv"))
|
112 |
|
113 |
threshold = 0.25
|
@@ -137,7 +140,7 @@ Mandolin: 0.710
|
|
137 |
Ukulele: 0.268
|
138 |
```
|
139 |
|
140 |
-
Technically, it's not a Mandolin nor a Ukulele, but
|
141 |
|
142 |
|
143 |
## Get audio scene embeddings
|
|
|
66 |
|
67 |
## Inference: get logits and probabilities
|
68 |
|
69 |
+
To run the following, first download ```254906__tpellegrini__cavaco1.wav``` and ```class_labels_indices.csv``` from this repository.
|
70 |
+
|
71 |
```python
|
72 |
sample_rate = 32000
|
73 |
audio_target_length = 10 * sample_rate # 10 s
|
74 |
|
75 |
# AUDIO_FNAME = "f62-S-v2swA_200000_210000.wav"
|
76 |
AUDIO_FNAME = "254906__tpellegrini__cavaco1.wav"
|
77 |
+
|
78 |
+
current_dir=os.getcwd()
|
79 |
+
AUDIO_FPATH = os.path.join(current_dir, AUDIO_FNAME)
|
80 |
|
81 |
waveform, sample_rate_ = torchaudio.load(AUDIO_FPATH)
|
82 |
if sample_rate_ != sample_rate:
|
|
|
111 |
# Equivalent: probs = torch.sigmoid(logits)
|
112 |
print("probs size:", probs.size())
|
113 |
|
|
|
114 |
lb_to_ix, ix_to_lb, id_to_ix, ix_to_id = read_audioset_label_tags(os.path.join(current_dir, "class_labels_indices.csv"))
|
115 |
|
116 |
threshold = 0.25
|
|
|
140 |
Ukulele: 0.268
|
141 |
```
|
142 |
|
143 |
+
Technically speaking, it's not a Mandolin nor a Ukulele, but a Brazilian cousin, the cavaquinho!
|
144 |
|
145 |
|
146 |
## Get audio scene embeddings
|