-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.json
1 lines (1 loc) · 49.4 KB
/
content.json
1
{"meta":{"title":"fumiaki.xyz","subtitle":null,"description":null,"author":"Tokuhisa, Fumiaki","url":"https://fumiaki.xyz"},"pages":[{"title":"about","date":"2016-09-18T16:22:49.000Z","updated":"2018-06-30T13:54:10.933Z","comments":true,"path":"about/index.html","permalink":"https://fumiaki.xyz/about/index.html","excerpt":"","text":""}],"posts":[{"title":"ダミーヘッドマイクを作ってみた","slug":"20210509-dummy-head-microphone","date":"2021-05-09T14:45:00.000Z","updated":"2021-05-09T14:43:12.897Z","comments":true,"path":"20210509-dummy-head-microphone/","link":"","permalink":"https://fumiaki.xyz/20210509-dummy-head-microphone/","excerpt":"","text":"はじめにオーディオに関する勉強をしようと思い、GWにダミーヘッドマイクの自作をしてみました。 ダミーヘッドマイクの自作をしたのは、オーディオに関する技術や用語・機材の使い方・音の良し悪しについて理解できるようになる必要があるなーと最近感じており、勉強するなら何かを作るのが自分には合っているのと、もともとダミーヘッドマイクの自作に興味があったからです。 方法と機材ダミーヘッドマイクの自作といっても、下記の動画を参考にして、既製品の組み合わせで難しいことはしていません。 参考にした動画:5分間DIY動画:ダミーヘッド・マイクロフォンの作り方 ただ、GW中に終わらせたかったのでリードタイムを考慮して動画とは異なる耳模型を使っています。また、最初はオーディオインターフェースやマイクに関する知識が足りず、それらをいくつか購入して試行錯誤しました(お金が飛んでいった……)。 最終的に、下記の部品・機材を使用しました。 マネキンヘッド:https://www.amazon.co.jp/gp/product/B078LZ511G/ 耳模型:https://www.amazon.co.jp/gp/product/B086HQ5FBT/ マイク:https://www.amazon.co.jp/gp/product/B07ZY6JXKL/ オーディオインターフェース:https://www.amazon.co.jp/gp/product/B07VKRNHWQ/ マネキンヘッドに下記の図のように穴を開け、耳模型をとりつけています。耳模型には、マイクを取り付ける穴を開けています。マイクの長さが耳模型の厚さより長いので、マネキンヘッドのマイクが入る部分は深めに掘る必要がありました。 結果作成したダミーヘッドマイクの周囲で、ハサミの音を鳴らしてみました。 はじめて作った割には、意外といい感じです。オーディオインターフェースをまだ使いこなせてないなぁと感じるので、直近はそこが改善すべき点かなと思います。 感想とこれから最初は、オーディオインターフェースなにそれ?という状態でしたが、ダミーヘッドマイクを自作してみて、だいぶオーディオ製品のページ等に書かれてる用語の意味が分かるようになったり、マイクが意外といろんな音を拾うなーというのが分かったりしたので、目的は達成できたかなと思います。 次は、複数のマイクを使用した信号処理系の何かをしたいな~と思っています(ただ、試行錯誤するのにお金がかかりすぎるのが悩み)。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"Audio","slug":"Diary/Audio","permalink":"https://fumiaki.xyz/categories/Diary/Audio/"}],"tags":[{"name":"Audio","slug":"Audio","permalink":"https://fumiaki.xyz/tags/Audio/"}]},{"title":"冬コミ(C97)サークル参加報告と2020年の抱負","slug":"c97-004","date":"2020-01-02T06:00:00.000Z","updated":"2020-01-03T23:10:59.044Z","comments":true,"path":"c97-004/","link":"","permalink":"https://fumiaki.xyz/c97-004/","excerpt":"","text":"はじめにあけましておめでとうございます。無事に冬コミで新刊の頒布ができました。サークルに来てくださった皆様ありがとうございました。十分休息もとれたので、冬コミの振り返りをして、新年の抱負を語ります。 冬コミで頒布した新刊について冬コミに参加し、新刊を頒布しました。新刊は、次の3つの動画で紹介しているコンテンツに使った技術について解説しています。1つめはVR、2つめはAR、3つめはAIともりもりの内容の本になりました。 振り返りと反省2019年は趣味開発を再開するぞ!という強い意志でものづくりをして、年の終わりに本を作ってコミケで頒布できたのはとても満足のいく結果でした。ただ、うまくいったことと反省しないといけないことはあるので、それを書いていきます。 趣味開発の方針について趣味開発をちゃんとやったのは5年ぶりくらいで、社会人になってからこんなにガッツリやったのは初でした。 自分の趣味開発をふりかえると、今回は第3次の開発期間です。第1次は大学入試前、第2次は大学在学中になります。第1次はプログラミング学び初めで多くのことを学習し、第2次は好きにアプリを作ってGooglePlayで配布したりと徐々にいろいろな挑戦や成長はできていってるなと思います。 今回の第3次で重要視したのは、開発したものを蓄積していくことと趣味開発を持続できるようにするということです。これは第2次でアプリ開発をした際に、作ったものが作ったきりになったり、作ったあとにメンテンナンスやサポートで時間を消費してしまうということを反省したからです。趣味開発は新しいことをやり続けたいので、過去に作ったものを簡単に再利用したり、開発以外で使う時間はなるべく少なくしたいと考えています。 そこで、今回の趣味開発は可能なかぎり開発をクラウドによせていこうという方針にしています。これは、異なるプラットフォーム向けに作ったアプリでも技術の再利用を簡単にしたり、端末依存で問題が生じることを減らすためです。この方針は、いまの時代だからこそやりやすくなった戦略かなと思います。それは、サーバレスの発展で個人でもサーバの利用料をあまり気にせず維持しやすくなったからです。ただ、クラウドによせるようにしたことで、レイテンシの問題が生じるので体験の質は下がりますし、利用料も完全には無視できません。このクラウドによせることのメリットとデメリットをふまえた上で、好きなものをつくるということと持続可能性のバランスを考慮したものづくりをしていきたいと思います。 執筆のスケジュールについて11/1に参加が決定して、12/21に印刷所に入稿、12/31にサークル参加というスケジュールでした。簡単なプロトタイプは事前に作ってましたが、新刊用に作り直しながら記事を書いたので、かなりキツかったです。仕事の方でも12月と1月リリースのアプリ開発をしていたので、11月と12月は起きてる間はずっと締切間近の何かを作っているという限界な状態でした。これは流石に持続不可能なので、やり方を変えていかないといけないなと思います。 ざっくりとした執筆のスケジュールは以下のような流れでした。 11月第1週でRe:VIEWの執筆環境を整えて1つめのネタの大まかな流れを決めた 11月の2週目以降は仕事が忙しく執筆できなかった 11月の最終週くらいに1つめのネタを記事用に作り直しながら執筆 12月の2週目からなぜか2つめと3つめのネタの記事を書き始める 12/14は自分の中で決めた入稿の締め切りだったがもちろん間に合わない 12月の3週目は記事の微修正と必要な画像素材をひたすら作る 12/21に表紙を急いで作って入稿 特に表紙はもっと良くしたいと思いました。締め切りの少し前からどんな表紙にするかをいろいろ考えてましたが、最後に急いで作ってしまってあまり満足のいく出来にならなかったのが一番の反省です。次の本はもっと表紙に力を入れたものにしたいです。 サークル参加について一人でコミケのようなイベントにサークル参加したのは初めてだったのでいろいろチャレンジしましたが、良かったこととイマイチだったことあったので列挙していきます。 良かったこと はじめての新刊を執筆できた。需要があるか不明だけど好きな内容を書いた 印刷所に入稿できた。綺麗に製本した本が頒布できたのは最高 展示用の動画を用意できた。音声を流せないことを考慮するともっと良くなりそう イマイチだったこと 宣伝が全然できなかったこと。直前に体調不良やデモの準備をしていて時間なかった デモの準備をしたが、デモしづらいコンテンツだったのでデモできなかった 当日の準備が足りなかった。文房具も足りなかったし、残った本を運ぶ台車は必要 2020年の抱負頒布した数は24部で、まだまだ在庫があるので、2020年は他のイベントにも参加していこうと思います。また、2019年は趣味のアプリのリリースはできてないので、誰でも体験できるようにアプリをリリースすることが目標です。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"}],"tags":[{"name":"C97","slug":"C97","permalink":"https://fumiaki.xyz/tags/C97/"}]},{"title":"Deep Learningでオタクグッズ・ムービーメーカーAI + C97宣伝③","slug":"c97-003","date":"2019-12-30T23:00:00.000Z","updated":"2019-12-30T23:07:50.195Z","comments":true,"path":"c97-003/","link":"","permalink":"https://fumiaki.xyz/c97-003/","excerpt":"","text":"はじめにDeep Learningを使ってオタクグッズ・ムービーメーカーAIというものを作りました!これは、自分が昔からたまに作っているフィギュア等のオタクグッズと技術でなんか楽しいものを作るシリーズの1つです。 作ったものオタクグッズ・ムービーメーカーAIは、その名の通りオタクグッズを使って動画を生成するAIです。次の図のように、オタクグッズの1種であるアクリルキーホルダーが写った画像を入力すると、その画像に応じた動画を出力します Deep Learningは、このアクリルキーホルダーの認識に使用しています。当初はDeep Leariningではない方法で実現を試みていましたが、TensorFlow Object Detection APIを使ったら一瞬でできてしまいました……(※学習データの作成は時間がかかる) 次の動画に生成される動画の例もあげています。 なかなか面白いものができましたが、まだいつでも試せるというところまでできてません。しばらくは、これを簡単に試せるシステムを作っていこうと思います。 C97の宣伝「ARAIHARI」というサークルで、コミケに初めてサークル参加しています。参加日は4日目(12/31)で、サークルスペースは「南ナ40a」です。 新刊では、本記事のオタクグッズ・ムービーメーカーAIを作る技術を書いています。TensorFlow Object Detection APIをGoogle Colaboratoryで使う方法も書いているので、Deep Learning用マシンが無くてもオタクグッズ・ムービーメーカーAIが作れるように記事を書いています。残念ながら本記事のコンテンツのデモは当日は準備できそうにないです。 ぜひ来てください!どうぞよろしくお願いします。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"}],"tags":[{"name":"C97","slug":"C97","permalink":"https://fumiaki.xyz/tags/C97/"}]},{"title":"写真から等身大パネルの3Dオブジェクトを簡単に作ってAR + C97宣伝②","slug":"c97-002","date":"2019-12-30T13:00:00.000Z","updated":"2019-12-30T12:58:32.643Z","comments":true,"path":"c97-002/","link":"","permalink":"https://fumiaki.xyz/c97-002/","excerpt":"","text":"はじめにAR用の3DオブジェクトをGUIでポチポチしながら作るのは大変なので、ある程度決まった形式のものは用意するのが簡単な素材から自動で作れないかな~、大量生産簡単にできないかな~と妄想していました。 次の図のように画像から等身大パネルのような3Dオブジェクトを作るのなら簡単にできそうだと思いついたので、今回は写真から3Dオブジェクトを作ってARで表示するシステムを開発しました。 作ったものできたものは次の動画のように写真から等身大パネルの3Dオブジェクトを作ってARで表示するシステムです。ARの表示は、AndroidのARCore Sceneformで実現しています。めちゃくちゃ簡単にできてびっくりしました。 C97の宣伝「ARAIHARI」というサークルで、コミケに初めてサークル参加しています。参加日は4日目(12/31)で、サークルスペースは「南ナ40a」です。 新刊では、等身大パネルのAR用3Dオブジェクトを作る技術を書いています。実はかなり簡単にできるので、試行錯誤しているときに作った使わなかった技術の話も書いています(完全にページ数を稼ぐためだけ……)。もし可能だったら、当日は本記事のコンテンツのデモもする予定です。 ぜひ来てください!どうぞよろしくお願いします。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"}],"tags":[{"name":"C97","slug":"C97","permalink":"https://fumiaki.xyz/tags/C97/"}]},{"title":"Oculus QuestのHand TrackingでユニティちゃんとVRダンス + C97宣伝①","slug":"c97-001","date":"2019-12-30T12:00:00.000Z","updated":"2019-12-30T11:50:54.618Z","comments":true,"path":"c97-001/","link":"","permalink":"https://fumiaki.xyz/c97-001/","excerpt":"","text":"はじめにOculus QuestのHand Trackingが使えるようになりました~。そこで、コミケ用に作ったユニティちゃんとダンスをするコンテンツをHand Trackingに対応させてみます。 作ったものコミケ用に作ったものから少し修正は必要でしたが、次の動画のようにHand Trackingでユニティちゃんと手を合わせてダンスをするコンテンツを作成できました! BGMは【d-elf.com】の楽曲を使用しています。 このコンテンツのシステムは、次の図のように音楽のBPMからユニティちゃんのモーションを生成して、さらにプレイヤーとキャラクターが自然に手を合わせられるようにユニティちゃんの動きをコントロールしています。 当初はコントローラーで実現していましたが、このコンテンツはHand Trackingの方が絶対いいですね。体験したらちょっと感動しちゃいました。 C97の宣伝「ARAIHARI」というサークルで、コミケに初めてサークル参加しています。参加日は4日目(12/31)で、サークルスペースは「南ナ40a」です。 新刊では、Oculus QuestでユニティちゃんとVRダンスをするための技術を書いています。流石にHand Trackingは新刊には間に合いませんでしたが、新刊の内容から部分的な修正のみで対応可能になります。もし可能だったら、当日は本記事のコンテンツのデモもする予定です。 ぜひ来てください!どうぞよろしくお願いします。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"}],"tags":[{"name":"C97","slug":"C97","permalink":"https://fumiaki.xyz/tags/C97/"}]},{"title":"声質変換に挑戦 #2","slug":"voice-conversion-002","date":"2019-05-16T13:18:55.000Z","updated":"2019-05-16T13:29:12.629Z","comments":true,"path":"voice-conversion-002/","link":"","permalink":"https://fumiaki.xyz/voice-conversion-002/","excerpt":"","text":"はじめに前回の続きです。新しいマイクを買ったので、それで収録した音声を世の中で公開されているCycleGANベースの実装で声質変換を試してみました。まだまだ目標には届かないですが、ちょっと音声は綺麗になったかなという印象です。 結果変換前(自分の声) 変換後(音質が悪いので注意)","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"MachineLearning","slug":"Diary/MachineLearning","permalink":"https://fumiaki.xyz/categories/Diary/MachineLearning/"}],"tags":[{"name":"MachineLearning","slug":"MachineLearning","permalink":"https://fumiaki.xyz/tags/MachineLearning/"}]},{"title":"声質変換に挑戦 #1","slug":"voice-conversion-001","date":"2019-05-05T10:50:53.000Z","updated":"2019-05-16T13:18:16.536Z","comments":true,"path":"voice-conversion-001/","link":"","permalink":"https://fumiaki.xyz/voice-conversion-001/","excerpt":"","text":"はじめにGWの連休を利用して、声質変換(voice conversion)に挑戦しました。目標の性能には至りませんでしたが、GWが終わるので一旦打ち切って現状を記します。 2019/05/05 公開2019/05/07 加筆・修正しました 目的と方法声質変換は、音声の話者情報を変換する技術です。例えば、Aさんが喋った音声をあたかもBさんが喋った音声のように変換することができます。 今回は、自分の音声を下記の女性の音声に変換することに挑戦します。目標は、変換した音声にその女性の音声らしさを感じられるレベルです。 変換先の音声:声優統計コーパスの藤東知夏様の音声 自分の技術的な興味から CycleGAN を使用した声質変換を行うことにしました。CycleGAN による声質変換は既存の研究がありますが、今回は技術的な理解を深めることも兼ねているので、既存の研究の技術を少しずつ取り入れながら作っていきます。 結果GW終了時点での結果は以下のようになりました。残念ながら目標の性能には至りませんでした。自分の声とは感じないですが、変換先の話者の音声とは思いづらい音声になりました。 変換前(自分の声) 変換後(音質が悪いので注意) 感想結果はイマイチでしたが、先人の成果を参考に試行錯誤したので、とても勉強になりました。 次に挑戦する際は、自分の音声の収録環境(なぜかフェードインして収録される…)の改善や未使用の技術を使い性能向上を目指します。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"MachineLearning","slug":"Diary/MachineLearning","permalink":"https://fumiaki.xyz/categories/Diary/MachineLearning/"}],"tags":[{"name":"MachineLearning","slug":"MachineLearning","permalink":"https://fumiaki.xyz/tags/MachineLearning/"}]},{"title":"複数の感覚による知覚表象","slug":"representation-001","date":"2019-03-03T14:55:00.000Z","updated":"2019-03-04T14:29:55.228Z","comments":true,"path":"representation-001/","link":"","permalink":"https://fumiaki.xyz/representation-001/","excerpt":"","text":"はじめに『表象ってナンだ?』 『表象(Representation)』ってなんでしょう……。最近、『表象』やそれに関連する抽象的な概念についての本を読んでますが、なんとなくの理解しかできてません。思考や図を描いての整理だけでは、なかなか納得できない部分もあります。 そういうわけで、簡単なシミュレーションの実験をして理解を深めたいと思います。今回は、『複数の感覚からの知覚』と『表象』について実験していきます。 ※注:本記事は、勉強中の自分の理解で書いているもので正確でない可能性が高いです。 表象について表象というのは、心の中に形成されるものだそうです。「そもそも心ってなんだよ!」とは思いますが、それは無視しておきます。そして、心の中に形成されるものといっても、以下のように形成の仕方はいろいろあるようです。 対象を知覚することにより心に表れる表象 記憶から心に表れる表象 思考によって心に表れる表象 場合によっては、知覚によるものは表象に含まないこともあるようですが、本記事では含むとします。また、記憶による表象と思考による表象は今回は考えません。 知覚表象知覚によって生じた表象である知覚表象を図にしてみます。 この図では、カレーの表象を心の中に形成するのに、視覚・嗅覚・味覚という複数の感覚から知覚しています。視覚・嗅覚・味覚が認識する性質はそれぞれ異なります。例えば、視覚は色や形という性質を認識しますが、嗅覚はそれらを認識することはできません。人は、これらの感覚が認識する性質を組み合わせて表象を形成することができているようです。 後の実験では、この複数の感覚による知覚表象についての理解を深めたいと思います。 実験今回の実験のモチベーションは、『複数の感覚で認識した性質を組み合わせて表象を形成するというのはどういうことだろう?』という疑問です。表象を形成するために、複数の感覚を統合しているわけですが、統合しないとどうなるのか・統合するというのはどういうことなのかについて理解を深めたいと思います。 生物の代わりに次のような仮想のロボットで実験したいと思います。ロボットは、感覚の代わりに以下のような3つのセンサーで対象のオブジェクトの形や色の性質を認識します。それぞれのセンサーは、範囲に含まれるオブジェクトの性質のみ認識できるとします。こんな単純なロボットで表象について考えるのは不自然かもしれませんが許容するとします。 大サイズのセンサーは、オブジェクトの枠の色を認識する 中サイズのセンサーは、オブジェクトの形(円や四角)を認識する 小サイズのセンサーは、オブジェクトの中の色を認識する このロボットは、枠が黒・形が円・中が赤の性質を持つオブジェクトを目標とすることにします。その目標のオブジェクトには近づいて、そうでないオブジェクトには近づかないという挙動になるようにします。 以降、センサーによる認識も感覚による認識とし、感覚を統合しないケース・感覚を統合するケースについて見ていきます。 感覚を統合しないケースロボットは、以下のようなシンプルな挙動をするとします。 実際に動かしてみると、対象が目標のオブジェクトの場合には問題ないです。しかし、対象が目標のオブジェクトでない場合に、1つの対象に対して異なる表象を形成すると下図のように動いてしまうことがあります。 (なんだか夜中に電球にアタックしている昆虫のような動きです。昆虫は感覚を統合せず表象を形成しているのでしょうか) 感覚を統合できないということは、効率的に目標に向かうのに障害になるであろうことがわかります。 感覚を統合するケース感覚を統合することで、同じ対象を複数の感覚で認識することができます。これにより、1つの対象に対して1つの表象を形成できます。「これで問題解決だぜ。やったー!」と言いたいところですが、実装しようとすると、新たな問題が出てきます。異なる器官で認識したものをどうやって同じ対象由来と判別するかという問題です。 今回は、この問題に対して、同じ位置にあるものは同じオブジェクトであるという仮定をして実装しました。これは、現実世界では複数の異なるオブジェクトが同じ位置で重なりあっていることは基本的にないからです。 実際に動かしてみて感覚を統合しないときに生じた問題は発生しないことは確認できました。 まとめ感覚を統合しないというのは、直感的に効率的ではないということは感じてましたが、実際に動かしてみて確認することができました。 一方で、感覚を統合して1つの対象から1つの表象を形成することの難しさを実装することによって発見できました。実際に人がどのように対処しているかは不明ですが、なんとかうまいことしてるんでしょうね。人って賢いな~と思います。今回の実装では位置を手がかりにしましたが、おそらく不十分でしょう。なぜなら、今の仮定ではオブジェクトが動いたりする場合にうまく対処できないからです。ここは将来的にもう少し理解を深めたいです。 余談表象は、実際に生物の仕組みに同等のものがあるとは限らず、実装して実験する価値があるのか分からないということもあり、書いている途中に心折れかけました(直近、役に立つ話でもないし…)。また、説明を書くにも使用する言葉が抽象的で正しいのか不明な部分が多くかなり苦労しました。ただ、表象については、他にも理解したいことがあるので、のんびり進めていこうと思います。 ちなみに、今回のようなテーマでもっと実践的なことをしたい場合は、マルチモーダル学習について研究すると良さそうです。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"Representation","slug":"Diary/Representation","permalink":"https://fumiaki.xyz/categories/Diary/Representation/"}],"tags":[{"name":"Representation","slug":"Representation","permalink":"https://fumiaki.xyz/tags/Representation/"}]},{"title":"チャットボット開発 その3 最初の試作","slug":"chatbot-development-003","date":"2019-02-16T16:10:00.000Z","updated":"2019-02-16T17:15:48.677Z","comments":true,"path":"chatbot-development-003/","link":"","permalink":"https://fumiaki.xyz/chatbot-development-003/","excerpt":"","text":"はじめに前回までは、主に Azure Bot Service 上でできることの調査でした。 今回は、とりあえず作るものを決めます。以下の項目を満たすものにしたいと思います。 完璧を目指すと難しいが、それっぽい結果を出すだけなら簡単なもの 作る過程で得られたものが再利用性が高いアセットになるもの チャットボット開発の小話12345678三連休の最終日の日曜、午前9時過ぎ。F氏は趣味で作っているチャットボットにどんな機能を実装するか悩んでいた。「うーん、ニュースを毎日教えてくれたら便利かな~。エンタメ系の機能なら俳句を詠むと面白いかも。」「ただ、どれも世の中に既に良いものがあるんだよな。」いつまでも良いアイデアが浮かばないことに焦っていた。一度思考をリセットしようと朝食を食べつつテレビを見ていると、ハッと閃いた。「そうだ!合体すればいいんだ。」こうしてニュースを575の文章にするチャットボットができたのだった。 これは半分冗談なんですが、まあこれくらい何を作ろうか悩みました。 悩んだ結果、物語の生成に興味があったので、こんな小話を生成するボットができたら面白いなと思いつきました。(ボットである必要性は微妙ですが……) 小話生成ボット試作試しに作った小話を生成するボットがこちらです。 やっていることは、テンプレートの文章に対して、キーワードを埋め込んでいるだけです。キーワードは「ニュース」や「ダジャレ」の部分が11種類あって、それらから組み合わせ可能なものを選んでくるという処理をしています。なるだけローコストで作れるように工夫はしましたが、それでもものすごく作りこみをしているので、たくさん作ることはできません。 当面は、もっと簡単な小話を量産できるものにしていこうと思います。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"Chatbot","slug":"Diary/Chatbot","permalink":"https://fumiaki.xyz/categories/Diary/Chatbot/"}],"tags":[{"name":"Chatbot","slug":"Chatbot","permalink":"https://fumiaki.xyz/tags/Chatbot/"}]},{"title":"チャットボット開発 その2 データの埋め込み・取得・保存","slug":"chatbot-development-002","date":"2019-02-07T13:40:00.000Z","updated":"2019-02-07T17:02:42.786Z","comments":true,"path":"chatbot-development-002/","link":"","permalink":"https://fumiaki.xyz/chatbot-development-002/","excerpt":"","text":"はじめに今回は、Azure Bot Service での実行ファイルへのデータの埋め込み・外部サーバーからのデータの取得・データの保存の記事です。 実行環境の調査がメインですが、ボットに「ニュース教えて」と言うとランダムにニュース記事のタイトルとURLを返す機能が付きました。 リソースの埋め込みアプリケーション リソースの管理 (.NET) 上記ページの方法では、単純な文字列については良いのですが、ファイルはリンクのみで埋め込みはできませんでした。ローカルではリンクのみでも問題ありませんでしたが、Bot Service にデプロイするとファイルを読み込めなくなったので下記の方法に変更しました。 ビルド アクション 上記ページの「埋め込みリソース」でファイルを埋め込んで読み込みができました。これで、正規表現の一覧を入れたファイルを読み込み、ユーザーからの問いかけを正規表現のマッチで分類しています。 RSSフィードの取得HttpClient Class 上記のHttpClientを使ってRSSフィードの取得を行いました。 不適切なインスタンス化のアンチパターン HttpClientは便利ですが、上記ページによると取り扱いに気を付けないといけないようです。 Microsoft.SyndicationFeed.ReaderWriter RSSの読み込みと解析は上記のライブラリを使用しました。 以下は、ボットがYahooニュースのRSSから取得したデータで返答している例です。 データの保存ストレージに直接書き込む 上記ページの通りにやれば、「各対話ごとに管理したいデータ」「対話間で共通でもつデータ」のどちらもストレージに保存できるようになりました。今回は、Blob Storage で各対話の状態の保存・読み込み、RSSの保存・読み込みを行いました。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"Chatbot","slug":"Diary/Chatbot","permalink":"https://fumiaki.xyz/categories/Diary/Chatbot/"}],"tags":[{"name":"Chatbot","slug":"Chatbot","permalink":"https://fumiaki.xyz/tags/Chatbot/"}]},{"title":"チャットボット開発 その1 環境構築","slug":"chatbot-development-001","date":"2019-02-04T12:20:00.000Z","updated":"2019-02-07T13:10:28.895Z","comments":true,"path":"chatbot-development-001/","link":"","permalink":"https://fumiaki.xyz/chatbot-development-001/","excerpt":"","text":"はじめにチャットボット(Chatbot)開発はじめました! 学生のころからたまに対話アプリっぽいものは作ってましたが、チャットボットは作ったことないなと思い作ることにしました。 目標は、以下の3つで、モチベーションの続く限りやっていこうと思います。 自分が使う便利な機能を開発 誰でも使えるよう公開 ちょっとスキルアップ 今回は、環境構築のみなので自分の備忘録程度の記事になります。 Azure Bot Serviceチャットボットの実行環境としては、Azure Bot Serviceを使用することにしました。理由は、以下の2点です。 Facebook Messenger と Slack への接続が簡単らしい Bot Service自体はシンプル 2つ目の理由が結構重要で、いろいろ試したいので、素の状態がシンプルな方が都合が良いと考えました。意図理解をする場合も自分で作ってみたり、LUIS等のサービスに繋げてみたりしたいと思います。 チャットボットの新規作成Azure Bot Service を使用してボットを作成する 上記ページの通りにやれば、ボットを作れるはずなのですが、なぜか自分は、App Service Plan の Location 選択でどこを選択してもエラーになる現象に遭遇しました。 一旦、App Service で適当な Web Appを作って、その際にできた App Service Plan を Bot Service の新規作成時に使用すると問題なく作れました。うーん、謎な挙動ですね。 Visual Studio で開発Bot Service で作成したボットは、Visual Studio を使ってローカルで開発することができます。 作成したボットのコードをダウンロードするには、Bot Service のページで対象のボットを選択し、ビルドのページの「zip ファイルをダウンロード」のボタンをクリックするとプロジェクトのzipファイルが手に入ります。あとは、そのzipファイルをローカルで展開して、Visual Studio で開けば準備完了です。 F5 で実行すれば、ローカルでボットが動きます。お手軽ですね。 エミュレーターでテストエミュレーターを使用したデバッグ 実行中のボットは上記ページの Bot Framework Emulator を使うとテストができます。Bot Framework Emulator で対象のボットの.botファイルを開いて、ローカルで動いている development のボットとサーバで動いている production のボットをテストすることができます。 デプロイデプロイの仕方は、Bot Serviceからダウンロードしたプロジェクトの README.md に詳細が記載されています。Visual Studio上で、デプロイ画面を開いて操作するだけなので楽々でした。","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"Chatbot","slug":"Diary/Chatbot","permalink":"https://fumiaki.xyz/categories/Diary/Chatbot/"}],"tags":[{"name":"Chatbot","slug":"Chatbot","permalink":"https://fumiaki.xyz/tags/Chatbot/"}]},{"title":"ROSのアプリ開発環境セットアップ","slug":"ros-app-development-setup","date":"2016-10-10T13:08:00.000Z","updated":"2018-06-30T13:54:10.933Z","comments":true,"path":"ros-app-development-setup/","link":"","permalink":"https://fumiaki.xyz/ros-app-development-setup/","excerpt":"","text":"はじめにRealSenseを使ったアプリケーションを開発するために,ROSのセットアップを行いました.普段利用しているMacのOS X El Capitan上で開発するために,VMwareでUbuntuの仮想環境を構築し,CLionで開発することにしました. VMwareセットアップUbuntuをインストール今回は,ROS Indigoを使うので,サポートしているUbuntu 14.04をインストール. open-vm-toolsのインストール以下のコマンドを実行して,open-vm-toolsをインストール.画面をウィンドウサイズにあわせることなどができるようになり便利. 123sudo apt-get updatesudo apt-get install -y open-vm-toolssudo apt-get install -y open-vm-tools-desktop キーボード設定以下のコマンドでmozcをインストール 1sudo apt-get install ibus-mozc 使用する入力ソースをMozcに変更 Macのスペース横のEisuキーとHiraganaキーで日本語オン・オフを切り替えるために,Mozcキー設定を変更しました.モードが入力変換中・変換中・入力文字なしで入力キーがEisuのときIMEを無効化,モードが直接入力で入力キーがHiraganaのときIMEを有効化します.同じモード・入力キーの組み合わせ設定が既に存在してる場合は,上書きしてください. VMwareのキーマッピングの設定を変更 ROSのセットアップROS Indigo をインストール.基本的にはwikiをそのまま利用. 1234567891011121314151617sudo apt-get install -y chronysudo ntpdate -q ntp.ubuntu.comsudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116sudo apt-get updatesudo apt-get install -y ros-indigo-desktop-fullsudo rosdep initrosdep updateecho "source /opt/ros/indigo/setup.bash" >> ~/.bashrcsource ~/.bashrcsudo apt-get install -y python-rosinstallmkdir -p ~/catkin_ws/srccd ~/catkin_ws/srccatkin_init_workspacecd ~/catkin_wscatkin_makeecho "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc ROSの環境変数を設定.他のマシンでRealSenseを動かしてるので,ちゃんと設定する必要があります. 123echo "export ROS_MASTER_URI=http://192.168.179.15:11311/" >> ~/.bashrcecho "export ROS_HOSTNAME=192.168.65.133" >> ~/.bashrcsource ~/.bashrc 上記コマンドの192.168.179.15がroscoreが動いてるマシンのIPアドレス,192.168.65.133が仮想環境に割り当てられているIPアドレスになります. 共有フォルダ設定~/catkin_ws/srcフォルダにOS XからアクセスしてGit使ったりしたかったので,共有フォルダの設定を行いました.自分の環境だと,VMwareの共有フォルダ機能が動作しなかったため,Sambaを使いました. Sambaのパスワードを設定しないとOS XのFinderからアクセスできなかったので,以下のコマンドでパスワードを設定. 1sudo smbpasswd -a <ユーザ名> あとは,共有したいフォルダを右クリックしてプロパティから共有の設定する. CLionセットアップCLionは,使えたら使おっかなーと思ってセットアップしましたが,何も困難なことなく動作しました.catkin_create_pkg で生成したディレクトリをそのまま読み込めば,ビルドもデバッグを可能です.以下は,ブレークポイントを使ったデバッグをしたときの画面です. 失敗編この節は,セットアップの失敗記録です. OS X でROSビルドの時点でかなり困難でした.なんとかビルドできましたが,実行時にエラーが出たので断念.各パッケージごとのエラーに対処していくのは現実的ではないと判断しました… VirtualBoxでUbuntuとROS3Dアクセラレーションを有効にするとrvizはエラーが発生し,3Dアクセラレーションを無効にするとrvizが重すぎるので断念しました. DockerでUbuntuとROSSSHのX11転送機能を使ってrvizの画面を表示しようとしたが,エラーが出たので断念.","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"ROS","slug":"Diary/ROS","permalink":"https://fumiaki.xyz/categories/Diary/ROS/"}],"tags":[{"name":"ROS","slug":"ROS","permalink":"https://fumiaki.xyz/tags/ROS/"}]},{"title":"Intel の RealSense Robotic Development Kit を買った","slug":"realsense-robotic-devkit-setup","date":"2016-09-28T15:44:21.000Z","updated":"2018-06-30T13:54:10.918Z","comments":true,"path":"realsense-robotic-devkit-setup/","link":"","permalink":"https://fumiaki.xyz/realsense-robotic-devkit-setup/","excerpt":"","text":"はじめに標題の通り,Intel の RealSense Robotic Development Kit を買いました.新しいおもちゃだ!わーい!RealSense Robotic Development Kitは,ボードとRealSense(R200)がセットになったKitです.ただし,現在(2016年9月)のこのR200は一つ前のモデルのようです. セットアップ基本的には,チュートリアルを見ながらセットアップを行いました.セットアップには,有線マウス・キーボード・USBメモリが必要です(amazon の prime now で注文したら30分で届いてびびった). チュートリアルではlibrealsenseの古いバージョン(v0.9.2)を使っていたので,そこだけ新しいバージョン(v1.9.7)に変更しました. 1git checkout tags/v1.9.7 作業時間は3時間くらいですが,ほとんどがダウンロード時間なので,ネットワーク環境が良ければもっと速く終わると思います. 動作確認librealsense/bin/cpp-capture を動かして動作確認しました.ちゃんと動いてそうですね.Kitだと,環境構築に躓く心配が少ないのでいいですね. 計画むかしむかしスマホで撮った画像で特定物体認識アプリ作って遊んだりしたので,その延長的な感じで遊ぼうと思います.とりあえず,特徴量を抽出する方法を調べる予定.","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"RealSense","slug":"Diary/RealSense","permalink":"https://fumiaki.xyz/categories/Diary/RealSense/"}],"tags":[{"name":"RealSense","slug":"RealSense","permalink":"https://fumiaki.xyz/tags/RealSense/"}]},{"title":"なめろうとさんが焼きを作った","slug":"namerou-and-sanga-yaki","date":"2016-09-19T12:37:09.000Z","updated":"2019-02-16T16:23:19.418Z","comments":true,"path":"namerou-and-sanga-yaki/","link":"","permalink":"https://fumiaki.xyz/namerou-and-sanga-yaki/","excerpt":"","text":"はじめにスーパーで刺身を買ってきて,なめろうとさんが焼きを作りました.作業時間は30分くらいでした. 材料123456789101112なめろうの材料: - 刺身:今回は,まぐろとサーモンとイカ - 刺身のつまとけん:大根,人参,きゅうり - 大葉 - 小ねぎ - ごま - にんにく醤油につけてたにんにく - ゆずの村 - 味噌:今回は八丁味噌(家にこれしかなかった)使ったけど,ちょっと失敗だったさんが焼きの材料: - 作ったなめろう - 大葉 手順なめろう基本的に材料を全部たたくだけ.ゆずの村と味噌を加える前のなめろうは以下. これに八丁味噌を加えすぎた & そもそも八丁味噌じゃない味噌の方が良さそうということで,さんが焼きを多めに作ることにした(焼けばなんとかなるやろの精神). さんが焼き作ったなめろうを大葉の上に置いて焼いた.作ったなめろうを全部使えば,さんが焼きは4個作れる.今回は3個つくった. 結果このようになりました.さんが焼きを多めに作って大正解!!なめろうは味が濃すぎた.ごまを入れると美味しいという知見を得た.","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"Cooking","slug":"Diary/Cooking","permalink":"https://fumiaki.xyz/categories/Diary/Cooking/"}],"tags":[{"name":"Cooking","slug":"Cooking","permalink":"https://fumiaki.xyz/tags/Cooking/"}]},{"title":"JupyterLabの拡張機能を作ってみた","slug":"jupyterlab-sample-extension","date":"2016-09-19T01:22:35.000Z","updated":"2018-06-30T13:54:10.918Z","comments":true,"path":"jupyterlab-sample-extension/","link":"","permalink":"https://fumiaki.xyz/jupyterlab-sample-extension/","excerpt":"","text":"はじめにJupyterLabに拡張機能の仕組みが提供されたようなので,試しに拡張機能を作ってみました.まだ安定版ではないようなので,この記事の内容は今後不正確になる可能性が高いです. JupyterLabについてJupyterLabは,Jupyter Notebookをベースに拡張したものです.Jupyter Notebookとの違いとしては,以下のような画面の分割機能やタブ機能があります. 普段は,Jupyter Notebookを使っており,そろそろJupyterLabに乗り換えたいなーと思ってます. JupyterLabの拡張機能について拡張機能の仕組みは,できてから日が浅いようでドキュメントもほとんどないです.今回は,以下のページを参考にしました. JupyterLab Tutorial Documentation : JupyterLabの一般的なチュートリアル JupyterLab Extension Builder : JupyterLabの拡張機能を作るツール Jupyter Widgets JupyterLab Extension : JupyterLabの拡張機能のプロジェクトは,これ以外見当たらなかった Enable Third Party Extensions #814 拡張機能作成の全体の流れまずは,拡張機能のプロジェクトディレクトリを作ります.今回は,samplelabextensionという名前で作ります. 123mkdir samplelabextensioncd samplelabextensionnpm init プロジェクトに必要なライブラリをインストール 123456npm install --save jupyterlabnpm install --save phosphornpm install --save-dev jupyterlab-extension-buildernpm install --save-dev rimrafnpm install --save-dev typedocnpm install --save-dev typescript 次に,samplelabextension/src ディレクトリ下に拡張機能のスクリプトを書きます.今回は,独自のhtmlを表示する拡張機能とし,typescriptで書きました. samplelabextension/src/tsconfig.json : typescriptの設定 samplelabextension/src/plugin.ts : 拡張機能のエントリーポイントとなるスクリプト samplelabextension/src/html.ts : 表示するhtml このスクリプトは後でjavascriptに変換して samplelabextension/lib ディレクトリ下に保存されます. samplelabextension/scripts/buildExtension.js を使って, 拡張機能のスクリプトをビルドします. 123456789var path = require('path');var buildExtension = require('jupyterlab-extension-builder').buildExtension;buildExtension({ name: 'samplelabextension', entry: './lib/plugin', outputDir : './samplelabextension/static'}); あとは,package.jsonのscriptsに色々書いたり, 1234567891011\"scripts\": { \"clean\": \"rimraf docs && rimraf lib && rimraf samplelabextension/static\", \"build:src\": \"tsc --project src\", \"build:extension\": \"node scripts/buildExtension.js\", \"build\": \"npm run build:src && npm run build:extension\", \"example:browser\": \"cd examples/browser && npm run update && npm run build\", \"example:node\": \"cd examples/node && npm install\", \"build:examples\": \"npm run example:browser && npm run example:node\", \"docs\": \"typedoc --mode file --module commonjs --excludeNotExported --target es5 --moduleResolution node --out docs/ src\", \"prepublish\": \"npm run build\" }, setup.pyに色々書いたり,MANIFEST.inを書いたり,samplelabextension/samplelabextension/__init__.py を書いたり,samplelabextension/samplelabextension/_version.py を書いたりすれば終わりです. ビルドして, 12npm run buildpython setup.py install 拡張機能としてインストールすれば,使えるようになります. 12jupyter labextension install --py samplelabextensionjupyter labextension enable samplelabextension --py JupyterLabを起動すれば,新たなCommandsが追加され,独自のhtmlを表示できています.","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"jupyterlab","slug":"Diary/jupyterlab","permalink":"https://fumiaki.xyz/categories/Diary/jupyterlab/"}],"tags":[{"name":"jupyterlab","slug":"jupyterlab","permalink":"https://fumiaki.xyz/tags/jupyterlab/"}]},{"title":"Hello World","slug":"hello-world","date":"2015-11-11T12:16:33.000Z","updated":"2018-06-30T13:54:10.918Z","comments":true,"path":"hello-world/","link":"","permalink":"https://fumiaki.xyz/hello-world/","excerpt":"","text":"HugoからHexoに変えた Quick StartCreate a new post1$ hexo new \"My New Post\" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment 数式$\\pi = 3$ こんにちは世界 $\\sum$$$a = b + c$$.","categories":[{"name":"Diary","slug":"Diary","permalink":"https://fumiaki.xyz/categories/Diary/"},{"name":"hexo","slug":"Diary/hexo","permalink":"https://fumiaki.xyz/categories/Diary/hexo/"}],"tags":[{"name":"hexo","slug":"hexo","permalink":"https://fumiaki.xyz/tags/hexo/"}]}]}