38 int32 tot_len = in[0].NumRows(),
39 dim = in[0].NumCols();
40 for (
int32 i = 1;
i < in.size();
i++) {
42 tot_len += in[
i].NumRows();
46 for (
int32 i = 0;
i < in.size();
i++) {
47 int32 this_len = in[
i].NumRows();
48 out->
Range(len_offset, this_len, 0, dim).CopyFromMat(
50 len_offset += this_len;
57 int main(
int argc,
char *argv[]) {
59 using namespace kaldi;
63 "Concatenate feature files (assuming they have the same dimensions),\n" 64 "so the output file has the sum of the num-frames of the inputs.\n" 65 "Usage: concat-feats <in-rxfilename1> <in-rxfilename2> [<in-rxfilename3> ...] <out-wxfilename>\n" 66 " e.g. concat-feats mfcc/foo.ark:12343 mfcc/foo.ark:56789 -\n" 67 "See also: copy-feats, append-vector-to-feats, paste-feats\n";
72 po.
Register(
"binary", &binary,
"If true, output files in binary " 73 "(only relevant for single-file operation, i.e. no tables)");
82 std::vector<Matrix<BaseFloat> > feats(po.
NumArgs() - 1);
93 }
catch(
const std::exception &e) {
94 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void ConcatFeats(const std::vector< Matrix< BaseFloat > > &in, Matrix< BaseFloat > *out)
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)
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
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).
#define KALDI_ASSERT(cond)
void WriteKaldiObject(const C &c, const std::string &filename, bool binary)
SubMatrix< Real > Range(const MatrixIndexT row_offset, const MatrixIndexT num_rows, const MatrixIndexT col_offset, const MatrixIndexT num_cols) const
Return a sub-part of matrix.
void Resize(const MatrixIndexT r, const MatrixIndexT c, MatrixResizeType resize_type=kSetZero, MatrixStrideType stride_type=kDefaultStride)
Sets matrix to a specified size (zero is OK as long as both r and c are zero).
int main(int argc, char *argv[])