Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gst-kaldi-nnet2-online
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
homeostasis
gst-kaldi-nnet2-online
Commits
cde5f180
Commit
cde5f180
authored
10 years ago
by
tanel
Browse files
Options
Downloads
Patches
Plain Diff
cosmetic fixes
parent
45d19375
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README
+7
-0
7 additions, 0 deletions
README
src/Makefile
+6
-1
6 additions, 1 deletion
src/Makefile
src/gstkaldinnet2onlinedecoder.cc
+41
-47
41 additions, 47 deletions
src/gstkaldinnet2onlinedecoder.cc
src/gstkaldinnet2onlinedecoder.h
+0
-1
0 additions, 1 deletion
src/gstkaldinnet2onlinedecoder.h
with
54 additions
and
49 deletions
README
+
7
−
0
View file @
cde5f180
...
...
@@ -25,10 +25,17 @@ cd src
Compile, specifying Kaldi's root directory:
make depend
KALDI_ROOT=/path/of/kaldi-trunk make
This should result in 'libgstkaldionline2.so'.
Test id GStreamer can access the plugin:
GST_PLUGIN_PATH=. gst-inspect-1.0 kaldinnet2onlinedecoder
HOW TO USE IT
-------------
...
...
This diff is collapsed.
Click to expand it.
src/Makefile
+
6
−
1
View file @
cde5f180
all
:
KALDI_ROOT
?=
/home/tanel/tools/kaldi-online
KALDI_ROOT
?=
~/tools/kaldi-online
ifeq
("$(wildcard $(KALDI_ROOT)/src/kaldi.mk)","")
$(
error
Cannot find Kaldi
's makefile
$(
KALDI_ROOT
)
/src/kaldi.mk. \
Specify Kaldi'
s root directory using KALDI_ROOT when issuing make, e.g.:
`
KALDI_ROOT
=
~/tools/kaldi-trunk make
`
)
endif
include
$(KALDI_ROOT)/src/kaldi.mk
ifneq
($(KALDI_FLAVOR), dynamic)
...
...
This diff is collapsed.
Click to expand it.
src/gstkaldinnet2onlinedecoder.cc
+
41
−
47
View file @
cde5f180
/*
* GStreamer
* Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* Copyright (C) 2014 Tanel Alumae <<user@hostname.org>>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* Copyright 2014 Tanel Alumae <tanel.alumae@phon.ioc.ee>
* Copyright 2014 Johns Hopkins University (author: Daniel Povey)
*
* Alternatively, the contents of this file may be used under the
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in
* which case the following provisions apply instead of the ones
* mentioned above:
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
* WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
* MERCHANTABLITY OR NON-INFRINGEMENT.
* See the Apache 2 License for the specific language governing permissions and
* limitations under the License.
*/
/**
* SECTION:element-kaldinnet2onlinedecoder
*
*
FIXME:Describe kaldinnet2onlined
ecoder
here
.
*
Converts speech to text using Kaldi's SingleUtteranceNnet2D
ecoder.
*
* <refsect2>
* <title>Example launch line</title>
* |[
* gst-launch -v -m fakesrc ! kaldinnet2onlinedecoder ! fakesink silent=TRUE
* GST_PLUGIN_PATH=. gst-launch-1.0 --gst-debug="kaldinnet2onlinedecoder:5" -q \
* filesrc location=123_456.wav ! decodebin ! audioconvert ! audioresample ! \
* kaldinnet2onlinedecoder model=nnet2_online_ivector_online/final.mdl fst=tri3b/graph/HCLG.fst word-syms=tri3b/graph/words.txt \
* feature-type=mfcc mfcc-config=nnet2_online_ivector_online/conf/mfcc.conf \
* ivector-extraction-config=ivector_extractor.conf max-active=7000 beam=11.0 lattice-beam=5.0 \
* do-endpointing=true endpoint-silence-phones="1:2:3:4:5" ! filesink location=tmp.txt
* ]|
* </refsect2>
*/
...
...
@@ -766,11 +746,22 @@ static void gst_kaldinnet2onlinedecoder_finalize(GObject * object) {
delete
filter
->
endpoint_config
;
delete
filter
->
feature_config
;
delete
filter
->
nnet2_decoding_config
;
if
(
filter
->
simple_options
)
{
delete
filter
->
simple_options
;
filter
->
simple_options
=
NULL
;
delete
filter
->
simple_options
;
if
(
filter
->
feature_info
)
{
delete
filter
->
feature_info
;
}
if
(
filter
->
trans_model
)
{
delete
filter
->
trans_model
;
}
if
(
filter
->
nnet
)
{
delete
filter
->
nnet
;
}
if
(
filter
->
decode_fst
)
{
delete
filter
->
decode_fst
;
}
if
(
filter
->
word_syms
)
{
delete
filter
->
word_syms
;
}
G_OBJECT_CLASS
(
parent_class
)
->
finalize
(
object
);
}
...
...
@@ -799,16 +790,19 @@ static gboolean kaldinnet2onlinedecoder_init(
* compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
*/
#ifndef PACKAGE
#define PACKAGE "
myfirstkaldinnet2onlinedecoder
"
#define PACKAGE "
Kaldi
"
#endif
/* gstreamer looks for this structure to register kaldinnet2onlinedecoders
*
* exchange the string 'Template kaldinnet2onlinedecoder' with your kaldinnet2onlinedecoder description
*
* License is specified as "unknown" because gstreamer doesn't recognize "Apache" as
* a license and blacklists the module :S
*/
GST_PLUGIN_DEFINE
(
GST_VERSION_MAJOR
,
GST_VERSION_MINOR
,
kaldinnet2onlinedecoder
,
"
Template
kaldinnet2onlinedecoder"
,
kaldinnet2onlinedecoder_init
,
VERSION
,
"
LGPL
"
,
"GStreamer"
,
"kaldinnet2onlinedecoder"
,
kaldinnet2onlinedecoder_init
,
VERSION
,
"
unknown
"
,
"GStreamer"
,
"http://gstreamer.net/"
)
}
This diff is collapsed.
Click to expand it.
src/gstkaldinnet2onlinedecoder.h
+
0
−
1
View file @
cde5f180
...
...
@@ -102,7 +102,6 @@ struct _Gstkaldinnet2onlinedecoder
nnet2
::
AmNnet
*
nnet
;
fst
::
Fst
<
fst
::
StdArc
>
*
decode_fst
;
fst
::
SymbolTable
*
word_syms
;
//OnlineNnet2FeaturePipeline *feature_pipeline;
};
struct
_Gstkaldinnet2onlinedecoderClass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment