Siddarth commited on
Commit
83c8d77
·
verified ·
1 Parent(s): f901865

Update Main.py

Browse files
Files changed (1) hide show
  1. Main.py +5 -2
Main.py CHANGED
@@ -17,6 +17,7 @@ from tqdm import tqdm
17
  import time
18
 
19
  import numpy as np
 
20
 
21
  warnings.filterwarnings("ignore")
22
 
@@ -33,7 +34,9 @@ main_path = data['MainPath']
33
  device = data['Device']
34
  diag_attn = data['DiagAttn']
35
 
36
- BestModelPath = '/home/siddc/SiddC/Misc/WatchMeSpeak/WatchMeSpeak/Best_GlobalModel_500_0_0.pt'
 
 
37
 
38
  def pre_process_mfcc(mfcc):
39
 
@@ -47,7 +50,7 @@ def pre_process_mfcc(mfcc):
47
 
48
  def wav2art(wav):
49
  rate = 16000
50
- mfcc = librosa.feature.mfcc(wav, 16000, n_mfcc=13, hop_length=int(0.010*rate), n_fft=int(0.020*rate))
51
  mfcc = pre_process_mfcc(mfcc)
52
 
53
  mfcc = torch.tensor([mfcc]).float()
 
17
  import time
18
 
19
  import numpy as np
20
+ import os
21
 
22
  warnings.filterwarnings("ignore")
23
 
 
34
  device = data['Device']
35
  diag_attn = data['DiagAttn']
36
 
37
+ dir_path = os.path.dirname(os.path.realpath(__file__))
38
+
39
+ BestModelPath = dir_path + '/Best_GlobalModel_500_0_0.pt'
40
 
41
  def pre_process_mfcc(mfcc):
42
 
 
50
 
51
  def wav2art(wav):
52
  rate = 16000
53
+ mfcc = librosa.feature.mfcc(y = wav, sr = 16000, n_mfcc=13, hop_length=int(0.010*rate), n_fft=int(0.020*rate))
54
  mfcc = pre_process_mfcc(mfcc)
55
 
56
  mfcc = torch.tensor([mfcc]).float()