Masayuki Takigahira

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 74 total)
  • Author
    Posts
  • in reply to: Automating HARK input with Batch Process #1497

    Thank you for your inquiry.

    First, create a network file for file input using AudioStreamFromWave . This is a normal network file that takes one WAV file as input. Please refer to Cookbook and Samples for how to create a network file.
    Next, change the parameter type of the Constant node that is inputting the file name from string to subnet_param , and change the parameter value to ARG1 or string:ARG1 . Please refer here for the meaning of ARG<number> .
    With this change, you can change the file name arbitrarily with the argument, so you can execute as follows.

    If you want a network file named network.n to process a WAV file named input.wav:

    
    harkmw ./network.n ./input.wav
    

    After that, just write the loop of the file name as follows with shell script.

    If you have a file list:

    
    for f in <code>cat filelist.txt</code>; do
      harkmw ./network.n ${f};
    done
    

    Of course, you can also do the following.

    
    for f in your_path/*.wav; do
      harkmw ./network.n ${f};
    done
    

    Note:
    Generally, you should also change the output file. If you forget your changes, they will be overwritten during the loop. Do the same with parameters that set the output filename (or parameters that affect the output filename) for SaveWavePCM or Save...(your save node name)... in a similar way to the input file. The difference is that it uses ARG2 which means the second argument.

    Best regards,
    HARK support team

    in reply to: HARk gui error #1495

    Hello

    Thank you for your inquiry.

    From the information in the screenshot I saw that the machine with HARK installed appeared to be separate from the machine it was working on, making a remote connection. If you have a remote connection, please try the following steps.

    The behavior when no options are given to the hark_designer command is to start the HARK-Designer server, then start the browser and connect as a client. That is, it tries to boot for use on the local machine.

    Step1:
    When making a remote connection, it is necessary to start up only the HARK-Designer server, so it is necessary to start it as follows.

    
    hark_designer allowremote
    

    Note:
    If port number 3000 is not available (for example, another application is using it), you need to change the port number.
    If you need to change the port number used to connect HARK-Designer from the initial value of 3000, give the environment variable as follows and start hark_designer.

    If you want to set the port number to 4000:

    
    PORT=4000 hark_designer allowremote
    

    Step2:
    After the server is up, launch a browser (Firefox, Chrome, etc.) on the machine you are working on and connect to the machine where HARK is installed.

    If the port number is 4000 and the IP is 11.22.33.44 then:

    
    http://11.22.33.44:4000/
    

    Best regards,
    HARK support team

    in reply to: HARK connection with KALDI GUI #1459

    All samples we provide from the download page have been confirmed to be executable in advance. First of all, let’s check what is the cause.

    Step 1: After extracting the downloaded sample file, please execute according to the included readme_en.txt without changing any files.
    If it does not work at this stage, you have failed to install HARK and KaldiDecoder. Check the installation method and try the installation process again.

    Step 2: Overwrite final.mdl under the kaldi_conf/chain_sample/tdnn_5b/ directory with final.mdl of your acoustic model. And replace the HCLG.fst , phones.txt , word.txt , and phones/ directory's files under the kaldi_conf/chain_sample/tdnn_5b/graph_multi_a_tri5a_fsh_sw1_tg/ directory with the graph files of your language model.
    You may see an error message when performing the steps of “(1) Launch Kaldi” written in readme_en.txt. The error message usually describes the cause of the crash. If you use iVector, you need to replace the files under kaldi_conf/chain_sample/extractor with the iVectorExtractor generated when training your model. If you do not use iVector, you need to delete the "--ivector-extraction-config=kaldi_conf/ivector_extractor.conf" line in the contents of kaldi_conf/online.conf . Furthermore, the number of contexts written in kaldi_conf/conf/splice.conf may be different from when you trained your acoustic model. In that case, it needs to be modified. These are determined by your acoustic model training settings.
    If you are getting the error message continuously here, please provide a screenshot of the error message. If the error message disappears, KaldiDecoder has started successfully. You can work with HARK by matching the features in the next step.

    Step 3: If you execute “(2) Execute HARK” in readme_en.txt as it is, KaldiDecoder will crash with an error message that the dimensions are different. If the settings of splice and sub-sampling-factor are appropriate, it is possible to cope by matching the dimension of the feature and changing the type of feature.
    In the sample provided by us, the feature’s number of dimensions is set to 40. Please change it according to the number of dimensions of the features used for training your acoustic model.
    Note: This sample set includes two network files. One is practice2-2-2.n for online that is executed in real time with a microphone array, and the other is practice2-2-2_offline.n for offline (also processing with a WAV file recorded with microphone arrays). Both are set for TAMAGO microphone arrays. We recommend that you first test using the offline version.

    Step 4: If no error message is displayed, but the recognition result is incorrect, check the following. We recommend MSLS features that can be generated by HARK for speech recognition, but they are not common. If created using the usual procedure in Kaldi, MFCC features should be used. practice2-2-2.n and practice2-2-2_offline.n use the MSLSExtraction node. By changing the MSLSExtraction node of the network to the MFCCExtraction node using HARK-Designer, it is possible to connect correctly with the acoustic model learned with general MFCC features.

    Sincerely,
    HARK Support Team

    in reply to: HARK connection with KALDI GUI #1448

    Hi Riya-san,

    I don’t know the KALDI GUI, so I’ll suggest two solutions and I hope you choose the one that suits your purpose.

    1. How to use a third-party external Kaldi decoder.
    If an external Kaldi decoder requests a PCM stream, it can be obtained in the following way.
    HARK has a node called HarkDataStreamSender, which can obtain PCM data (and localization data if necessary) via Socket.
    Please refer to HarkDataStreamSender for usage.
    In this case, you need to parse the PCM data coming from HARK and format it to match the input of the decoder you use. Many people use small scripts such as Python or node.js for this purpose.

    2. How to use the KaldiDecoder we have provided.
    HARK has a function to convert PCM data to MSLS (or MFCC) features, so it sends a stream of features to KaldiDecoder. Sent from HARK using SpeechRecognitionClient node.

    If you are not sure how to set the file path given to KaldiDecoder, please refer to the following sample file.
    Samples
    HARK_recog_3.0.0_IROS2018_practice2.zip

    The config file included in this sample uses relative paths. Since it is a relative path from the place to execute, we are recommended to use the absolute path when executing from various places.
    For example, if I refer to your ScreenShot, it will be like an attached file. Since the location of the acoustic model (final.mdl) was not known from your ScreenShot, that part is a dummy. You can rewrite it in the same way, so please try it.
    If you are not using iVector in your acoustic model, you need to remove the ivector’s configuration line from the attached config file.

    Note: This sample uses our own MSLS features, so if you want to rewrite this sample and use it, you will need to replace the MSLSExtraction node with the MFCCExtraction node. The MFCC features generated by the MFCCExtraction node are compatible with those used by HTK Toolkit, Kaldi, etc. Please match the number of dimensions and the presence or absence of Delta and Accelerate.

    Sincerely,
    HARK Support Team

    Attachments:
    in reply to: RASP-ZXでの伝達関数測定 #1315

    お問い合わせありがとうございます。

    1.既に書かれていらっしゃるように、RASP-ZXの場合はマイクを自由に配置可能ですので次のような手順で作成します。
    1) 最初に作成するマイク座標ファイルは何を選択しても問題ありません。直線配置であればマイク座標はgridがよさそうです。音源座標は、次の「2.」の回答で書いているように通常はcircleやsphereが良いと思われます。点の数がマイクの個数以上となるように設定して作成します。
    2) Top画面に戻ってから、出来上がったマイク座標ファイルを編集します。「Visualize」というボタンを押すと、右側に現在の配置が描画され、左側に座標リストが表示されます。リストの右側にある丸の中に「-」というボタンを押すと指定行の座標が削除されます。(注:途中のidを削除した場合は連番になるように編集の最後に「reset id」ボタンを押してください。)
    なお、座標の単位は[m]で、(X,Y,Z)=(1,0,0)方向が0度(正面)です。例えば、0度を基準として左右の音源と分離するのであればマイクアレイが15cm間隔ですので、座標上はY軸方向に0.15間隔で並べてください。HARKが出力する角度情報は、X,Y,Zがすべて0となる位置からの角度となりますので、マイクアレイの中心が(X,Y,Z)=(0,0,0)となるようにする事をお勧めします。(注:RASP-ZXは本体から最も遠い末端が1chでRASP-ZXに近づくにつれてch番号が増えます。マイク配置の順番もマイクのch順になるように注意してください。)
    3) Top画面に再度戻ってから、「Download」ボタンで座標ファイルを保存されることをお勧めします。

    2.音源位置は実際に使用される環境に合わせて作成します。テレビのように正面180度にしか話者がいない前提の場合は半円で良いですし、ロボットのように全方位に人がいる場合は360度で作成します。例えば座席に座っている人と後ろに立っている人を分離するようなケース(高さが異なる位置の話者同士を分離したい場合)では球体のように配置すべきです。つまり、用途に合わせて音源があると考えられる位置のリストを作成してください。通常の用途ではcircleやsphere、半径は1m前後で問題ないと思われます。席に座っている場合のみを想定するのであれば半径60cmぐらいでも良いと思われますが、これも実際の用途に合わせてご設定ください。

    3.伝達関数とは音の伝播を表す関数ですので、特定の空間でのマイク位置と音源位置の音の伝わりが分かる(例:遅延、減衰は距離などに起因します)必要があります。つまり、マイク座標と音源座標が分からなければ幾何計算できません。単に収録したPCMデータを指定するためのファイルではないのでご注意ください。逆にTSP収録した場合に座標ファイルが必要になる理由は、その伝播がどの音源位置であるかを結びつけるためにあります。そのため、誤った情報を与えると誤った結果を(正しく?)返します。

    4.ダウンロードできる伝達関数とは、下記のURLからダウンロードできるものでしょうか?もし、その認識で合っていましたら「Other Information (Common for TSP recording and geometric calculation transfer function)」という項目がありますので、ご確認ください。恐らくですが、ここに記載している5度毎72方位(マイクアレイ中心からの仰角16.7度)の円形配置という設定と、作成された際の設定で異なるためと考えられます。ご質問の「2.」で書かれているのは伝達関数作成マニュアルの設定かと思われますが、このマニュアルの説明での作成例ですのでご注意ください。
    https://www.hark.jp/document/supported/

    以上、宜しくお願い致します。

    お問い合わせありがとうございます。

    こちらの投稿 を既にご覧になっているとの事でしたので、マルチチャネルの場合に必要となる情報だけ回答させて頂きます。

    hark_msgs/HarkWavench に送信するチャネル数を設定して頂き、マルチチャネルのPCMデータは wavedata が各チャネルのデータで、 src にチャネル順に格納して頂ければ送信可能です。

    Thomas氏が投稿されたソースコードをお借りするならば、

    
    result = []
    result.append(harkwaveval)
    

    の部分がマルチチャネルの場合は次のようになります。

    
    result = []
    result.append(harkwaveval_ch0)
    result.append(harkwaveval_ch1)
    result.append(harkwaveval_ch2)
    ...
    

    なお、AudioStreamFromRosノードでは下記のように実装しております。C/C++をよく書かれている方でしたら下記のソースコードの方が分かりやすいかもしれません。

    
    for (int k = 0; k < nb_channels; k++) {
      for (int i = 0; i < length; i++) {
        (*output)(k, i) = cbf->deque_wave[0].src[k].wavedata[i];
      }
    }
    

    https://www.hark.jp/download/source-code/
    上記URLでHARKの全ソースコードを公開しておりますので、その他の部分についても実装内容を確認する事が可能です。

    ———-

    data_bytes の件、書き忘れました。全チャネル分になりますのでご注意ください。

    以上、ご参考になれば幸いです。

    in reply to: ロボットNAOの伝達関数 #1249

    お問い合わせありがとうございます。

    > どこかで伝達関数ファイルが公開されているようならそれについても教えていただけると幸いです。

    製造元(*1)にお問い合わせ頂くのが一番ですが、どのような条件で作成されたものか分からなかったり公開自体をしていない可能性が高く、ご自身で作成して頂くのが確実かと思われます。
    *1) アルデバランロボティクスは、2016年5月よりソフトバンクロボティクスに名称が変更された様です。

    HARKで使用する伝達関数ファイルはHARKTOOL5で作成が可能です。HARKTOOL5のドキュメントにつきましては下記のURLをご参照ください。
    https://www.hark.jp/document/packages/harktool5-gui-en/index.html (English Ver.)
    https://www.hark.jp/document/packages/harktool5-gui-ja/index.html (日本語版)

    伝達関数の作成方法として実測ベースと幾何計算ベースの2通り御座いますが、実測ベースの伝達関数の作成方法については下記のURLから動画で確認する事が出来ます。
    https://www.hark.jp/document/harktv/

    幾何計算ベースの場合、マイクアレイの正確なマイク配置が分かっていれば作成する事が可能(*2)です。もし、製造元からサイズ入りのCAD図面や仕様などが入手できる場合は、TSP収録を行わず幾何計算で作成する事も可能となります。
    *2) HARKTOOL5上でマイクの配置と音源の配置を与える事で計算されます。マイク座標が自動生成出来る配置ではない場合、個数だけ合わせて頂きEditで個々のマイク座標を修正する事で任意のマイク配置を指定する事が可能です。

    下記に幾何計算ベース/実測ベースでの伝達関数作成方法のドキュメントが御座いますので、もし宜しければ併せてご確認ください。
    https://www.hark.jp/document/transfer-function-generation-manuals/

    > NAOの伝達関数の作成時のノウハウについてご教授いただきたいです。

    伝達関数ファイルの作成上の主な注意点などは動画内の説明やドキュメント内の記述に御座います。
    また、Forum上では伝達関数作成についての疑問点などについても回答させて頂いておりますので、Forumの検索機能などをご活用頂ければ幸いです。
    例として、下記は実測ベースの伝達関数作成時における適切なTSPの収録音量について回答しております。
    https://wp.hark.jp/forums/topic/generating-transfer-function/

    以上、よろしくお願いいたします。

    in reply to: 音源までの距離推定について #1239

    お問い合わせありがとうございます。

    > どういった改造を施せば可能となるのか教えていただけると幸いです。

    クックブックに古い記述が残っていたようです。
    https://www.hark.jp/document/changelog/
    の HARK2.1.0 更新履歴で記述されているようにコード上は既に3D定位/分離対応済みとなっております。

    該当する記述は下記の部分です。

    • NewFeatures
    • Released HarkTool5. HarkTool5 is a platform-independent WEB-based generating transfer function tools. This tool has the same features as conventional HarkTool4 with 3D support.
    • Released libharkio3. libharkio3 was designed for file I/O format unification and the consolidation of the matrix operation code etc.

    HARK 1.2.0 から HARK 2.0.x までの LocalizeMUSIC では、3次元座標に対応しているものの MUSICスペクトルのピーク探索が1次元的に行われていましたが、 HARK 2.1.0 以降は libharkio3 による新しい伝達関数フォーマットで近傍情報を保持出来るように再設計され、その近傍情報を元に3次元空間における局所最大でピーク探索を行うように変更されています。近傍とみなす範囲は伝達関数の作成時にHARKTool5の設定で変更できます。
    そのため、方位角/仰角/距離の異なる音源位置からの伝達関数を準備して頂くことで空間内の位置座標を得る事が可能です。注意点として、マイクアレイの各マイクが得たい位置に対して異なる位置に並んでいなければ高い精度が出ない事です。
    サポートハードウェアであるTAMAGO-03を例に挙げると水平面上に円形配置されているため方位角に対して高い精度が出ますが、異なる高さにマイクが無いため仰角方向の精度は出しにくくなります。仰角方向で精度を出すためには例えばマイク配置を2段や3段の円形に配置するような工夫が必要となります。
    yoshi様が希望される距離の測定はその点から考慮するとマイク配置のみで解決しようとすると難しいですが、3点測量などの手法を併用する事で比較的容易に算出する事が可能です。具体的な例を挙げるとマイクアレイを2セット用意し、各LocalizeMUSICの定位結果を用いて3点測量で距離を推定する等です。
    なお、複数の定位結果から3点測量を行って出力するコードはHARK-Pythonを用いる事により、C++でノードを書いてコンパイルするといった手間なくHARK内の処理で完結させることが出来ます。
    定位結果を外部に送るノード(HarkDataStreamSender)もありますので、外部で定位結果を受け取っているのであれば各マイクアレイ用に2つのネットワークファイルを起動して外部で2つの結果を受信して推定処理を行うという手段でも良いと思われます。

    以上、ご参考になれば幸いです。

    in reply to: Error: Bad WAVE header #1135

    Thank you for your inquiry.

    The WAV file format supported by the AudioStreamFromWave node is as follows:
    – signed 16bit / 24bit PCM
    – WAV-Ex header is not supported.
    Please see this page for details.
    https://www.hark.jp/document/hark-document-en/subsec-AudioStreamFromWave.html

    Your WAV file could not be loaded due to the following:
    – IEEE float 32bit PCM
    Unfortunately, this format is not supported by the AudioStreamFromWave node.

    Solution:
    To correct a file that AudioStreamFromWave could not read, follow these steps:

    Step.1: Please open the WAV file in Audacity. This is the same state as immediately after recording.
    Step.2: Please trace like “File => Export => Export Audio…” and display the Export Audio dialog.
    Step.3: Please select “Other uncompressed files” for the file type.
    Step.4: Please select “WAV (Microsoft)” for the “Header:” item. Please do not choose “WAVEX (Microsoft)” here.
    Step.5: Please select “Signed 24-bit PCM” for the “Encoding:” item. TAMAGO-03 has 24-bit resolution. Please select “Signed 16-bit PCM” for other 16-bit microphone arrays.
    Step.6: Please click “Save” button.

    Best regards,
    HARK support team

    in reply to: Notification of access failure (August 23, 2019 13:00 JST) #1132

    We confirmed that it returned to the normal state.

    Sincerely,
    HARK support team

    in reply to: Notification of access failure (August 23, 2019 13:00 JST) #1128

    You can check the latest status of AWS from the “Asia Pacific” tab at https://status.aws.amazon.com/ .

    in reply to: Recording audio stream from ROS – data type error #1122

    You need to use hark_msgs/HarkWave in your workspace.
    In your case, audio_common_msgs/AudioData seems to store mp3 data into uint8[] array, so you will first need to expand it to raw PCM data.

    Second, the data structure of hark_msgs/HarkWave is as follows.

    user@ubuntu:~$ rosmsg show hark_msgs/HarkWave
    std_msgs/Header header
      uint32 seq
      time stamp
      string frame_id
    int32 count
    int32 nch
    int32 length
    int32 data_bytes
    hark_msgs/HarkWaveVal[] src
      float32[] wavedata

    wavedata is a raw PCM data array. Since HARK is not aware of the number of bits, it simply casts an integer value to a floating point type. In other words, 123 is 123.0f .

    data_bytes is the data size. In other words, it is the size of float (4 bytes) multiplied by the size of wavedata .

    length is the number of samples per frame handled by HARK. The initial value of HARK is 512 . Since HARK processed frame by frame, in other words, the size of wavedata must be nch times length=512 .

    nch is the number of channels. Your device seems to be 1ch, so it should be 1 . For microphone array data, a larger number will be stored.

    count is the frame count. Since HARK processing frame by frame, it is necessary to know what frame the data is. In other words, it is incremented as the frame advances. The first frame number is 0 . Not 1 .

    There is a final note. In order to prevent problems in FFT/IFFT processing, etc., the frames processing by HARK are subject to sample overlap processing.
    The following image may help you understand.
    frames

    Best regards,
    m.takigahira

    in reply to: How to receive data from HarkDataStreamSender #1121

    Sample code is not provided from the official website, but specifications and source code are available. I hope you find it helpful.
    There is only one point to note. Since the data is transmitted in little endian, it is not in the network byte order generally called.

    Please refer to the next url for specifications.
    https://www.hark.jp/document/hark-document-en/subsec-HarkDataStreamSender.html

    The source code can be obtained with the following command on Ubuntu.
    apt source hark-core

    In the case of Windows environment, it is probably easy to download from the following URL.
    http://archive.hark.jp/harkrepos/dists/bionic/non-free/source/
    You can download any version by clicking the following file name on the browser. The <version> will be in the form of “x.x.x”.
    hark-core_<version>.tar.gz

    Best regards,
    m.takigahira

    in reply to: Can wios work on Windows10? #1116

    The Windows version of wios supports only the function to record via the network that RASP-24 etc. supports. In other words, wios can be used only when recording over the network with a USB-LAN or USB-Wireless dongle inserted into the USB port of the RASP-ZX.

    Currently, when connecting directly with a USB cable, you can only create a WAV file with a third-party recording tool such as Audacity. HARKTOOL5 can create a transfer function with an Complex Regression Model that does not require synchronized recording.

    https://www.hark.jp/document/packages/harktool5-gui-en/harktool5-gui.html#fd-conv-label

    If you need a TSP wav file created by synchronized recording, the following workaround also exists.

    Please create Ubuntu installed the virtual machine on VMWare/VirtualBox on Windows and connect RASP-ZX to the virtual machine. In that case, you can record with ALSA.

    Best regards,
    m.takigahira

    ——————————————————————————————

    Since I noticed that there was a mistake, I deleted it immediately after the following post. wios did not support both WASAPI and DirectSound (DS) at this time. Only the RASP protocol that cannot be supported by the standard Windows API is supported.

    The RASP-24 is connected via a LAN, and the recording data is transmitted over the network using the SiF original protocol and recorded using the SiF original interface.

    The USB Audio Class (UAC) supported devices connected via USB, such as TAMAGO-03, are recorded with WASAPI or DirectSound (DS) interface.

    RASP-ZX supports two connection methods.
    If you are connected directly to a PC with a USB cable, it will be recorded with WASAPI or DS interface. On the other hand, if a USB-LAN or USB-Wireless dongle is inserted into the USB port and you are trying to connect via a network, it will be connected with the SiF original protocol as same as RASP-24.

    You need to choose a wios command depending on which connection method you use.

    Notes:
    HARK has supported WASAPI since version 3.0, but wios has not yet completed support for WASAPI, DirectSound (DS) will be used. The effect of this difference will hardly occur.

    Best regards,
    m.takigahira

    > 私の環境上直近で用意できるのがnnet1モデルのみであるため、
    > どうにかnnet1で動作させたいという思いがございます。
    理解しました。

    > ご教示いただいた内容からnnet3の場合Kaldiのモデル作成からやり直す必要が
    > あるように見受けられますがnnet1の場合も同様なのでしょうか。
    MSLS特徴量を使用したい場合は、HARKでしかMSLS特徴量を生成できませんので再学習が必要になります。一方で広く一般的に使われるMFCC特徴量もHARKで計算する事が出来ますので、性能等に差が出る場合もございますがMFCC特徴量で学習されたモデルをKaldiDecoderで使う事は可能です。
    HARKの分離音をSaveWavePCMで出力して学習に使用された場合などは、CSJの学習レシピを変更していなければKaldiがMFCC特徴量に変換して学習しているはずですので、再学習しなくても設定変更だけで済むものと思われます。その場合、お使いの環境で下記の変更が必要となります。

    1.HARKのネットワークファイルの差し替え
    Kaldi公式レシピでPCMデータから学習している場合、KaldiDecoderには40次元のMFCC特徴量を入力する必要があります。上の投稿にありますように、入力した特徴量形式と次元数が一致していれば特徴量空間での適応処理(fMLLR)を行って作成されたモデルの場合でも問題なくデコードできます。
    HARK_recog_2.3.0.1_practice2 に含まれるネットワークファイルでは特徴量の次元数が異なりますので修正が必要です。40次元の特徴量を作るHARKのネットワークファイルのサンプルは、 HARK_recog_3.0.0_practice2.zip に含まれております。注意点として、 MSLSExtraction ノードでMSLS特徴量を生成している部分を MFCCExtraction ノードに置き換えて頂く必要が御座います。MFCCExtractionノードのパラメータは MSLSExtraction と同じように40次元となるように設定して差し替えてください。

    2.KaldiDecoderに渡すconfigファイルの変更
    上の投稿にありますように、KaldiDecoderに読み込ませるconfファイルへ下記の行を追記してください。
    --splice=17

    以上、宜しくお願い致します。

Viewing 15 posts - 16 through 30 (of 74 total)