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g}nh9gfW6MW$95GvQ(&(ESkm;UZ!JSmW(*ynp$sFmMe
zF=FMjKYj$^qoN$o-bA3I)L()9j1z0jVayykN;)p(ty3;rPZG{{)j~V%rFg;QDl&gS
zTTjOxMt{z~BRn_p`ydKE-yPpv`FEW%b^LbpC(n+QLw)J+rO4-@D%f15_xtqO?l%6;
zy%U>vDn|BuWJTFlK4}6n;m9%f0DQJ2yoi_2=QQ=gGGT1pj(068Seb
z!m850=fWLrccM4b)>FCpE;xj$%Da-^>45BlG8UspcVy?C%C6VlS-C8=v<92Rk|ZKfexUU1Ki$4AY3bHJzO$Z=PwpghQLBGUUj2j7)s5c>#niLW|>?pn*flRUoN
zMUls{&iHuRdXd}*$s3l1`kd)X_y_g7)viO`Qr8l_PiB4C5BD`$hcj*gOhr+GzxOPs;XTUznzr(C3i!mEz_E9m9xl72zz+a@xwYy&N*cq|F|p{uq_;Y?0M=vu`lxR
z!+O@V!VYwg)`PNMPo3cmf$|OV_P+`d4k@!nElYy&zpdU8ePyc%%Hpr1PV<)&J9hC>
zvanBx07ry8q52rzU5X<0zEFSV;Q=Wcr`3V-4BGgAK{+JA%t~Ztk7Hs2Is|CDvp-4|
zcuOLqJOiU75nfS&;bF`i7aw;Gd3IP-ghb*Q5*Qj7#msf_jrMj|VT&Rq5?^MXi@=@z
z?W-WdE6g`M)H5>5D@wx5XER|_E-We_LgMAiEO2#a?`sIcJcGi$BbkLRP2AhD$-vN=
z;So_@VLlSisF;}&MoL=s_X-SSV%=M^6?{UxA|oY{o=luiSaj&j7;~TS2#I-UbVyX7
zS44zYjGAYJ#3wu~GAbh4CrXWpm(@}W^Ocn{2`+*}Cef*hHo-k
z#%6|j(q3k|G<644=@}wnvV0bbF{bl{{hB-9r6GG
diff --git a/vz_acoustic_scene_analysis/scripts/stretch_audio.py b/vz_acoustic_scene_analysis/scripts/stretch_audio.py
index fd0ee16..8f3622e 100755
--- a/vz_acoustic_scene_analysis/scripts/stretch_audio.py
+++ b/vz_acoustic_scene_analysis/scripts/stretch_audio.py
@@ -17,21 +17,8 @@ import stretch_body.hello_utils as hu
hu.print_stretch_re_use()
from vz_acoustic_scene_analysis.msg import MyAudioData
from rospy.numpy_msg import numpy_msg
-
import NEU_VZ_ASA.MehrshadTesting.codes.A_CoughDetection.src.DSP as dsp
-model_path = '/home/hello-robot/clone/Robot_Autonomous_Navigation/catkin_ws/src/stretch_ros/vz_acoustic_scene_analysis/models/'
-cough_classifier_file = model_path + 'cough_classifier'
-cough_classifier_scaler = model_path + 'cough_classification_scaler'
-loaded_model = pickle.load(open(cough_classifier_file, 'rb'))
-loaded_scaler = pickle.load(open(cough_classifier_scaler, 'rb'))
-
-# model_loc = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
-# print(model_loc)
-from models import cough_classifier, cough_classification_scaler
-# Import Utku's script
-# from vz_acoustic_scene_analysis.models import cough_classifier as classifier
-# from vz_acoustic_scene_analysis.models import cough_classification_scaler as scaler
@contextmanager
def ignore_stderr():
@@ -216,7 +203,14 @@ class ROSInterface:
# Publisher for Audio Data
self.audio_data_pub = rospy.Publisher("/wav_data", numpy_msg(MyAudioData), queue_size=10)
# For Utku's code: float of cough probabilty from sample
- self.cough_prob = 0
+ self.cough_prob = 90
+
+ self.model_path = '/home/hello-robot/vz_modules/NEU_VZ_ASA/MehrshadTesting/codes/A_CoughDetection/models/'
+ self.cough_classifier_file = self.model_path + 'cough_classifier'
+ self.cough_classifier_scaler = self.model_path + 'cough_classification_scaler'
+ self.loaded_model = pickle.load(open(self.cough_classifier_file, 'rb'))
+ self.loaded_scaler = pickle.load(open(self.cough_classifier_scaler, 'rb'))
+
def get_audio(self):
@@ -282,7 +276,7 @@ class ROSInterface:
flat_list = [item for sublist in wav_data for item in sublist]
print(type(flat_list[0]))
# Call of Utku's function
- self.cough_prob = dsp.classify_cough(flat_list, RESPEAKER_RATE)
+ self.cough_prob = dsp.classify_cough(flat_list,RESPEAKER_RATE,self.loaded_model,self.loaded_scaler)
print(self.cough_prob)
# asa_out = process_wav(wav_data, asa_params)
# Convert asa_out to ROS message