16k model
Browse files- script.py +7 -2
- src/lcnn_model.py +1 -1
script.py
CHANGED
|
@@ -58,7 +58,12 @@ model = LCNN(return_emb=False).to(device)
|
|
| 58 |
# model_path = './checkpoints/LCNN_ALL_DATA_AUG.pth'
|
| 59 |
# model_path = './checkpoints/LCNN_ALL_DATA_TTS_AUG.pth'
|
| 60 |
# model_path = './checkpoints/LCNN_ALL_DATA_TTS_MOD.pth'
|
| 61 |
-
model_path = './checkpoints/LCNN_ALL_DATA_HI_FREQ_22050.pth'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
model.load_state_dict(torch.load(model_path, map_location=device))
|
| 63 |
|
| 64 |
# # MOE MODEL
|
|
@@ -128,7 +133,7 @@ for el in tqdm.tqdm(dataset_remote):
|
|
| 128 |
|
| 129 |
# RUNNING ON HUGGINGFACE
|
| 130 |
file_like = io.BytesIO(el["audio"]["bytes"])
|
| 131 |
-
tensor, sr = preprocess(file_like, target_sr=
|
| 132 |
# # RUNNING LOCALLY
|
| 133 |
# tensor = preprocess(el)
|
| 134 |
|
|
|
|
| 58 |
# model_path = './checkpoints/LCNN_ALL_DATA_AUG.pth'
|
| 59 |
# model_path = './checkpoints/LCNN_ALL_DATA_TTS_AUG.pth'
|
| 60 |
# model_path = './checkpoints/LCNN_ALL_DATA_TTS_MOD.pth'
|
| 61 |
+
# model_path = './checkpoints/LCNN_ALL_DATA_HI_FREQ_22050.pth'
|
| 62 |
+
|
| 63 |
+
model_path = './checkpoints/LCNN_ALL_DATA_FS_16000.pth'
|
| 64 |
+
# model_path = './checkpoints/LCNN_ALL_DATA_FS_22050.pth'
|
| 65 |
+
# model_path = './checkpoints/LCNN_ALL_DATA_FS_24000.pth'
|
| 66 |
+
|
| 67 |
model.load_state_dict(torch.load(model_path, map_location=device))
|
| 68 |
|
| 69 |
# # MOE MODEL
|
|
|
|
| 133 |
|
| 134 |
# RUNNING ON HUGGINGFACE
|
| 135 |
file_like = io.BytesIO(el["audio"]["bytes"])
|
| 136 |
+
tensor, sr = preprocess(file_like, target_sr=16000)
|
| 137 |
# # RUNNING LOCALLY
|
| 138 |
# tensor = preprocess(el)
|
| 139 |
|
src/lcnn_model.py
CHANGED
|
@@ -24,7 +24,7 @@ class LCNN(nn.Module):
|
|
| 24 |
def __init__(self, return_emb=False, num_class=2):
|
| 25 |
super(LCNN, self).__init__()
|
| 26 |
|
| 27 |
-
self.threshold = 0.
|
| 28 |
self.return_emb = return_emb
|
| 29 |
|
| 30 |
# Feature Extraction Part (First Part)
|
|
|
|
| 24 |
def __init__(self, return_emb=False, num_class=2):
|
| 25 |
super(LCNN, self).__init__()
|
| 26 |
|
| 27 |
+
self.threshold = 0.35
|
| 28 |
self.return_emb = return_emb
|
| 29 |
|
| 30 |
# Feature Extraction Part (First Part)
|