FrederikRautenberg commited on
Commit
3ddd5be
·
1 Parent(s): a58d533

fix bug creapy config

Browse files
pvq_manipulation/helper/creapy_wrapper.py CHANGED
@@ -120,7 +120,6 @@ def _hnr(data: np.ndarray, sound: pm.Sound, sr) -> float:
120
 
121
 
122
  def blockwise_feature_calculation(data: np.ndarray, sr, feature):
123
-
124
  sounds = [pm.Sound(values=block, sampling_frequency=sr) for block in data]
125
  function = FEATURE_MAPPING[feature]
126
  res = [function(block, sound, sr) for block, sound in zip(data, sounds)]
@@ -187,9 +186,7 @@ def process_file(data, sample_rate: int = 16_000):
187
  X_test = pd.DataFrame(X_all, columns=preprocessing_features + class_features)
188
 
189
  y_pred = np.zeros(creak_data_buff.shape[1])
190
- gender_model = user_cfg['gender_model']
191
- model_path = creapy.utils.helpers.get_root() / model_cfg["model_location"]
192
- model_path = (model_path.parent / f"{model_path.stem}_{gender_model.upper()}").with_suffix(".csv")
193
  model = load_model(model_path)
194
 
195
  y_pred[included_indices] = model.predict(_X_test)
 
120
 
121
 
122
  def blockwise_feature_calculation(data: np.ndarray, sr, feature):
 
123
  sounds = [pm.Sound(values=block, sampling_frequency=sr) for block in data]
124
  function = FEATURE_MAPPING[feature]
125
  res = [function(block, sound, sr) for block, sound in zip(data, sounds)]
 
186
  X_test = pd.DataFrame(X_all, columns=preprocessing_features + class_features)
187
 
188
  y_pred = np.zeros(creak_data_buff.shape[1])
189
+ model_path = Path("./models/creapy/model_ALL.csv")
 
 
190
  model = load_model(model_path)
191
 
192
  y_pred[included_indices] = model.predict(_X_test)