(self, path: str)
| 61 | return cv2.cvtColor(img, cv2.COLOR_BGR2RGB) |
| 62 | |
| 63 | def default_aud_loader(self, path: str) -> torch.Tensor: |
| 64 | speech_array, sampling_rate = librosa.load(path, sr = self.sampling_rate) |
| 65 | return self.wav2vec_preprocessor(speech_array, sampling_rate = sampling_rate, return_tensors = 'pt').input_values[0] |
| 66 | |
| 67 | |
| 68 | def preprocess(self, ref_path:str, audio_path:str, no_crop:bool) -> dict: |