head_st.append(k + " " + h) for e, k in enumerate(head_st): df[k] = Features[:, e] else: df = {} for e, k in enumerate(self.head): df[k] = Features[:, e] df["id"] = ids return pd.DataFrame(df) elif fmt == "torch": return torch.from_numpy(Features) elif fmt == "kaldi": if static: raise ValueError( "Kaldi is only supported for dynamic features") else: dictX = get_dict(Features, ids) save_dict_kaldimat(dictX, kaldi_file) if __name__ == "__main__": if len(sys.argv) != 6: print( "python glottal.py <file_or_folder_audio> <file_features> <static (true, false)> <plots (true, false)> <format (csv, txt, npy, kaldi, torch)>" ) sys.exit() glottal = Glottal() script_manager(sys.argv, glottal)
df[k] = Features[:, e] else: df = {} for e, k in enumerate(self.head): df[k] = Features[:, e] df["id"] = ids return pd.DataFrame(df) elif fmt == "torch": return torch.from_numpy(Features) elif fmt == "kaldi": if static: raise ValueError( "Kaldi is only supported for dynamic features") else: dictX = get_dict(Features, ids) save_dict_kaldimat(dictX, kaldi_file) else: raise ValueError(fmt + " is not supported") if __name__ == "__main__": if len(sys.argv) != 6: print( "python phonation.py <file_or_folder_audio> <file_features> <static (true, false)> <plots (true, false)> <format (csv, txt, npy, kaldi, torch)>" ) sys.exit() phonation = Phonation() script_manager(sys.argv, phonation)
df = {} for e, k in enumerate(self.head_st): df[k] = Features[:, e] else: df = {} for e, k in enumerate(self.head_dyn): df[k] = Features[:, e] df["id"] = ids return pd.DataFrame(df) if fmt == "torch": return torch.from_numpy(Features) if fmt == "kaldi": if static: raise ValueError( "Kaldi is only supported for dynamic features") dictX = get_dict(Features, ids) save_dict_kaldimat(dictX, kaldi_file) else: raise ValueError(fmt + " is not supported") if __name__ == "__main__": if len(sys.argv) != 6: print( "python prosody.py <file_or_folder_audio> <file_features> <static (true, false)> <plots (true, false)> <format (csv, txt, npy, kaldi, torch)>" ) sys.exit() prosody = Prosody() script_manager(sys.argv, prosody)
for e, k in enumerate(self.head_st): df[k] = Features[:, e] else: df = {} for e, k in enumerate(self.head_dyn): df[k] = Features[:, e] df["id"] = ids return pd.DataFrame(df) if fmt == "torch": return torch.from_numpy(Features) if fmt == "kaldi": if static: raise ValueError( "Kaldi is only supported for dynamic features") dictX = get_dict(Features, ids) save_dict_kaldimat(dictX, kaldi_file) else: raise ValueError(fmt + " is not supported") if __name__ == "__main__": if len(sys.argv) != 6: print( "python phonological.py <file_or_folder_audio> <file_features> <static (true, false)> <plots (true, false)> <format (csv, txt, npy, kaldi, torch)>" ) sys.exit() phonological = Phonological() script_manager(sys.argv, phonological)
if fmt in("dataframe","csv"): if static: df={} for e, k in enumerate(self.head_st): df[k]=Features[:,e] else: df={} for e, k in enumerate(self.head_dyn): df[k]=Features[:,e] df["id"]=ids return pd.DataFrame(df) if fmt=="torch": return torch.from_numpy(Features) if fmt=="kaldi": if static: raise ValueError("Kaldi is only supported for dynamic features") dictX=get_dict(Features, ids) save_dict_kaldimat(dictX, kaldi_file) else: raise ValueError(fmt+" is not supported") if __name__=="__main__": if len(sys.argv)!=7: print("python replearning.py <file_or_folder_audio> <file_features> <static (true, false)> <plots (true, false)> <format (csv, txt, npy, kaldi, torch)> <model (CAE,RAE)>") sys.exit() replearning=RepLearning(sys.argv[-1]) script_manager(sys.argv, replearning)
for h in self.head: head_st.append(k + " " + h) for e, k in enumerate(head_st): df[k] = Features[:, e] else: df = {} for e, k in enumerate(self.head_dyn): df[k] = Features[:, e] df["id"] = ids return pd.DataFrame(df) if fmt == "torch": return torch.from_numpy(Features) if fmt == "kaldi": if static: raise ValueError( "Kaldi is only supported for dynamic features") dictX = get_dict(Features, ids) save_dict_kaldimat(dictX, kaldi_file) if __name__ == "__main__": if len(sys.argv) != 6: print( "python articulation.py <file_or_folder_audio> <file_features> <static (true, false)> <plots (true, false)> <format (csv, txt, npy, kaldi, torch)>" ) sys.exit() articulation = Articulation() script_manager(sys.argv, articulation)