25 int main(
int argc,
char *argv[]) {
27 using namespace kaldi;
31 "Copy GMM based model (and possibly change binary/text format)\n" 32 "Usage: gmm-copy [options] <model-in> <model-out>\n" 34 " gmm-copy --binary=false 1.mdl 1_txt.mdl\n";
37 bool binary_write =
true,
42 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
43 po.
Register(
"copy-am", ©_am,
"Copy the acoustic model (AmDiagGmm object)");
44 po.
Register(
"copy-tm", ©_tm,
"Copy the transition model");
53 std::string model_in_filename = po.
GetArg(1),
54 model_out_filename = po.
GetArg(2);
60 Input ki(model_in_filename, &binary_read);
68 Output ko(model_out_filename, binary_write);
75 KALDI_LOG <<
"Written model to " << model_out_filename;
76 }
catch(
const std::exception &e) {
77 std::cerr << e.what() <<
'\n';
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int main(int argc, char *argv[])
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Register(const std::string &name, bool *ptr, const std::string &doc)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void Read(std::istream &is, bool binary)
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
int NumArgs() const
Number of positional parameters (c.f. argc-1).
void Write(std::ostream &os, bool binary) const
void Write(std::ostream &out_stream, bool binary) const
void Read(std::istream &in_stream, bool binary)