FC2カウンター FPGAの部屋 NLP SmartVision をやってみる2(音声の認識)
fc2ブログ

FPGAやCPLDの話題やFPGA用のツールの話題などです。 マニアックです。 日記も書きます。

FPGAの部屋

FPGAの部屋の有用と思われるコンテンツのまとめサイトを作りました。Xilinx ISEの初心者の方には、FPGAリテラシーおよびチュートリアルのページをお勧めいたします。

NLP SmartVision をやってみる2(音声の認識)

NLP SmartVision をやってみる1”の続き。

前回は、Kria KV260 Vision AI Starter Kit の NLP SmartVision をやってみたのだが、USB マイクが無いのでできなかった。今回は、 Google Command Dataset を取得して、音声の認識をしてみよう。

Testing Accuracy on Google Command Dataset”に従って進めて行く。

最初に Ubuntu 18.04 パソコンで Google_dataset ディレクトリを作成し、そこに入って、 speech_commands_v0.01.tar.gz を wget する。
mkdir Google_dataset
cd Google_dataset
wget http://download.tensorflow.org/data/speech_commands_v0.01.tar.gz

KRIA_KV260_61_210913.png

speech_commands_v0.01.tar.gz を展開する。
tar -xf speech_commands_v0.01.tar.gz
bed, bird, cat ... ディレクトリができたが、これはその単語をいろいろな人が発声した wav ファイルが入っている。
KRIA_KV260_62_210914.png

keywords ディレクトリを作成し、そこに on off up down left right yes no stop go ディレクトリを移動する。
mkdir keywords
mv -t ./keywords/ on off up down left right yes no stop go

KRIA_KV260_63_210914.png

wav ファイルのリストを書いたファイルの testing_list.txt を作成する。
keywords フォルダ以外のファイル、ディレクトリは削除する。
sed -n -e '/down\//p; /go\//p; /left\//p; /no\//p; /off\//p; /on\//p; /right\//p; /stop\//p; /yes\//p; /up\//p ' testing_list.txt > ./keywords/testing_list.txt
find . -maxdepth 1 ! -name keywords -print0|xargs -0 rm -r --

KRIA_KV260_64_210914.png

keywords ディレクトリを Kria KV260 Vision AI Starter Kit の PetaLinux に SFTP でアップロードした。
KRIA_KV260_65_210914.png

Kria KV260 Vision AI Starter Kit の PetaLinux での作業になる。
kv260-nlp-smartvision アプリケーションをロードした状態で音声を認識する。
sudo LD_LIBRARY_PATH=/opt/xilinx/lib nlp-smartvision --file-audio testing_list.txt
KRIA_KV260_66_210914.png
KRIA_KV260_67_210914.png
KRIA_KV260_68_210914.png

精度は 93.416 % だった。

down の認識状況の一部を貼っておく。

Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : unknown
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : silence
Ground truth : down     Prediction : down
Ground truth : down     Prediction : stop
Ground truth : down     Prediction : no
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : right
Ground truth : down     Prediction : unknown
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : no
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : go
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down
Ground truth : down     Prediction : down

  1. 2021年09月15日 04:21 |
  2. KRIA KV260 Vision AI Starter Kit
  3. | トラックバック:0
  4. | コメント:11

コメント

手順どおりに実施したのですが、「Ground truth :(空白)」が連続で表示されて、結果が以下となります。何が原因でしょうか。
Number of keywords tested =2567
Number of keywords detected correctly =2567
Accuracy=0%
  1. 2021/10/14(木) 12:15:08 |
  2. URL |
  3. a #-
  4. [ 編集 ]

”NLP SmartVision をやってみる1”の
sudo xmutil unloadapp
sudo xmutil loadapp kv260-nlp-smartvision
はKV260で実行してあるでしょうか?
  1. 2021/10/14(木) 20:27:23 |
  2. URL |
  3. marsee #f1oWVgn2
  4. [ 編集 ]

sudo xmutil unloadapp
sudo xmutil loadapp kv260-nlp-smartvision
はKV260で実行してあります。
  1. 2021/10/14(木) 20:41:25 |
  2. URL |
  3. a #-
  4. [ 編集 ]

そうですか。。。
原因は良く分かりません。私のやった手順はそのとおりにそのまま書いてあります。
何かが違うのかな?
  1. 2021/10/14(木) 21:09:18 |
  2. URL |
  3. marsee #f1oWVgn2
  4. [ 編集 ]

”NLP SmartVision をやってみる1”の
jupyter-server list
を実行したときに、サーバーのリストが何も出て来ません。
この辺りも違うような気がしています。
  1. 2021/10/14(木) 21:20:50 |
  2. URL |
  3. a #-
  4. [ 編集 ]

いつもお世話になります。2021_1のダウンロードしたwicファイルで手順に沿って実行し、手順の違いを探しています。以下確認お願いします。
sudo LD_LIBRARY_PATH=/opt/xilinx/lib nlp-smartvision --file-audio testing_list.txt
は、/opt/xilinx/lib の階層に、nlp-smartvisionを事前におくのでしょうか?/opt/xilinx/lib の階層を確認したところ、nlp-smartvisionの名前のファイルはなさそうです。
また、testing_list.txtは、以下のような編集をしていますか?パスを入れないとファイルを認識しないので編集しました。
/home/petalinux/notebooks/nlp-smartvision/keywords/down/022cd682_nohash_0.wav
  1. 2021/10/16(土) 00:36:37 |
  2. URL |
  3. a #-
  4. [ 編集 ]

何も追加で作業していません。ブログに書いてあるままに作業しています。
LD_LIBRARY_PATH=/opt/xilinx/libはライブラリの環境変数を設定しているだけだと理解しています。
  1. 2021/10/16(土) 04:15:12 |
  2. URL |
  3. marsee #f1oWVgn2
  4. [ 編集 ]

ご返信ありがとうございます。そうですか。。
あと、違っている箇所として、FileZillaの画面でpetalinuxの階層に、
.chache
.config
.ipython
.local
が私のwicファイルだとフォルダがありません。どの手順で生成されたフォルダでしょうか?
  1. 2021/10/16(土) 10:04:31 |
  2. URL |
  3. a #-
  4. [ 編集 ]

それは自分で作成したファイルじゃないので、いつできたか分からないですよ。。。
お手上げですが、私はやってきた手順はすべてブログに書いてありますので、最初の””設計開始 Kria KV260 ビジョン AI スターター キット使用”をやってみる1”から、その手順通りにやってみてはいかがですか?
https://marsee101.blog.fc2.com/blog-entry-5345.html
  1. 2021/10/16(土) 14:04:30 |
  2. URL |
  3. marsee #f1oWVgn2
  4. [ 編集 ]

いつもお世話になります。
testing_list.txtのアクセスのパスが原因のようでした。
同じように動作しました。
ブログ参考になります。ありがとうございました。
また、ご返信ありがとうございました。
  1. 2021/10/16(土) 14:44:27 |
  2. URL |
  3. a #-
  4. [ 編集 ]

良かったです。おめでとうございます。
  1. 2021/10/17(日) 15:02:34 |
  2. URL |
  3. marsee #f1oWVgn2
  4. [ 編集 ]

コメントの投稿


管理者にだけ表示を許可する

トラックバック URL
https://marsee101.blog.fc2.com/tb.php/5354-8e293934
この記事にトラックバックする(FC2ブログユーザー)