28 int main(
int argc,
char *argv[]) {
30 using namespace kaldi;
33 "Copy SGMM (possibly changing binary/text format)\n" 34 "Usage: sgmm2-copy [options] <model-in> <model-out>\n" 35 "e.g.: sgmm2-copy --binary=false 1.mdl 1_text.mdl\n";
37 bool binary_write =
true;
40 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
47 std::string model_in_filename = po.
GetArg(1),
48 model_out_filename = po.
GetArg(2);
54 Input ki(model_in_filename, &binary);
60 Output ko(model_out_filename, binary_write);
66 KALDI_LOG <<
"Written model to " << model_out_filename;
68 }
catch(
const std::exception &e) {
69 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void Write(std::ostream &os, bool binary, SgmmWriteFlagsType write_params) const
Class for definition of the subspace Gmm acoustic model.
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Read(std::istream &is, bool binary)
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
int main(int argc, char *argv[])