SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
FlashAir Developers Summit
FlashAirとCognitive Servicesを使おう!
2017年2月19日
綾瀬 ヒロ
Twitter @ayasehiro
2017/2/19 1All rights reserved. Copyright(C) 2017 AYASE Hiro
FlashAir Developers Summit
FlashAir Developers Summit
1.自己紹介
 綾瀬 ヒロ
Twitter:@ayasehiro
FlashAirエバンジェリスト(自称)
2017/2/19 2All rights reserved. Copyright(C) 2017 AYASE Hiro
運輸サービス系インダストリーマネージャです(元鉄道系SE)
趣味で庭園鉄道の建設をしていたりします。昔、Mac用フリーソフト「何かon
林檎」を作っていました。
Arduino/FlashAir/Xamarin/鉄道模型
Qiita: http://qiita.com/ayasehiro
MakersHub: https://makershub.jp/ayasehiro
FlashAir Developers Summit
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 3
本発表内容は、個人の見解であり、
所属する組織の公式見解ではありません。
FlashAir Developers Summit
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 4
作例1) 人物カウンター
FlashAir Developers Summit
作例1)人物カウンター 全体概要
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 5
Microsoft
Cognitive Services
Face API
(顔認識)
人数・年齢・性別を認識
画像ファイル
画像ファイル
画像ファイル
画像ファイル
画像ファイルの送信
60秒待機
年齢層別・男女別
人数カウント
最終更新日時の
画像ファイルを検索
60秒周期に
写真を撮影
実行スクリプト(Lua)
FlashAir IoT Hubに
データ送信
FlashAir Developers Summit
Microsoft Cognitive Services
 さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
FlashAir Developers Summit
Microsoft Cognitive Services
 Computer Vision API – 画像分析機能
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 7
FlashAir Developers Summit
Microsoft Cognitive Services
 Computer Vision API – 画像分析機能(タグ・キャプション等)
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 8
FlashAir Developers Summit
Microsoft Cognitive Services
 Computer Vision API – Describe Image機能
 画像データをもとに、タグ(属性)情報とキャプション(説明文)を自動生成する機能。
 JPEG, PNG, GIF, BMP形式に対応
 4MBまで
 50x50ピクセル以上が必要
 REST API
 Http MethodでPOSTするだけで、JSON形式でタグ・キャプション等の情報を取得できる
 無料利用可能
 1分間20リクエストまで
 1ヵ月5,000リクエストまで
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 9
Http Method POST
Request URL https://api.projectoxford.ai/vision/v1.0/describe[?maxCandidates]
Request parameters maxCandidates (optional) Maximum number of candidate descriptions to
be returned. The default is 1.
Request headers Content-Type (optional) Media type of the body sent to the API.
Ocp-Apim-Subscription-Key Subscription key which provides access to
this API. Found in your subscriptions.
FlashAir Developers Summit
作例1)人物カウンター
 Computer Vision API – Faces機能を利用
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 10
Faces : JSONメッセージ
[ { "age": 28, "gender": "Male",
"faceRectangle": { "left": 744, "top":
338, "width": 305, "height": 305 } } ]
FlashAir Developers Summit
作例1)人物カウンター
 Luaスクリプト例
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 11
boundary = "1234567890"
contenttype = "multipart/form-data; boundary=" .. boundary
mes = "--" .. boundary .. "¥r¥n"
.."Content-Disposition: form-data; name=¥"file¥"; filename=¥""..last_fname.."¥"¥r¥n"
.."Content-Type: image/jpg¥r¥n¥r¥n"
.."<!--WLANSDFILE-->¥r¥n"
.."--" .. boundary .. "--¥r¥n"
blen = lfs.attributes(last_fpath,"size") + string.len(mes) - 17
b, c, h = fa.request{url =
"https://westus.api.cognitive.microsoft.com/vision/v1.0/analyze?visualFeatures=Faces",
method = "POST",
headers = {["Content-Length"] = tostring(blen),
["Content-Type"] = contenttype,
[“Ocp-Apim-Subscription-Key”] = “ここにサブスクリプションキーを記述する",
["maxCandidates"] = "1"},
file = last_fpath,
body = mes
}
FlashAir Developers Summit
作例1)人物カウンター
 Luaスクリプト例
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 12
cjson = require "cjson”
if(c == 200) then
res = cjson.decode(b)
for idx=1,#res.faces do
local agenum = tonumber(res.faces[idx].age)
if(agenum < 20) then
faces_num_00 = faces_num_00 + 1
elseif(agenum >= 20 and agenum < 60) then
faces_num_20 = faces_num_20 + 1
elseif(agenum >= 60) then
faces_num_60 = faces_num_60 + 1
end
if( res.faces[idx].gender == "Female" ) then
faces_num_female = faces_num_female + 1
else
faces_num_male = faces_num_male + 1
end
end
end
FlashAir Developers Summit
作例1)人物カウンター
 Luaスクリプト例
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 13
iothub = require("iothub")
iothub.addMeasurement({
faces_num_00,
faces_num_20,
faces_num_60,
faces_num_male,
faces_num_female
})
FlashAir Developers Summit
作例1)人物カウンター 詳しくは・・・
 Qiitaの記事を参照ください。
http://qiita.com/ayasehiro/items/9651e1231951766fbe12
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 14
FlashAir Developers Summit
作例1)人物カウンター 全体概要
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 15
Microsoft
Cognitive Services
Conputer Vision API
(顔認識)
人数・年齢・性別を認識
画像ファイル
画像ファイル
画像ファイル
画像ファイル
画像ファイルの送信
60秒待機
年齢層別・男女別
人数カウント
最終更新日時の
画像ファイルを検索
60秒周期に
写真を撮影
実行スクリプト(Lua)
FlashAir IoT Hubに
データ送信 Azure IoT Hub
Stream Analytics
Azure IoT Hub
+Stream Analytics
+Power BI
でもできるんだからね!
FlashAir Developers Summit
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 16
作例2) 音声で鉄道模型を運転
FlashAir Developers Summit
iOSアプリ
powered by Xamarin
作例2)音声で鉄道模型を運転 全体概要
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 17
Microsoft
Cognitive Services
Bing Speech API
(音声認識)
LUIS -
Language Understanding
Intelligent Service
(自然言語認識)
音 声 録 音
文字列取得・送信
PWM出力
ポイント制御
Intent・Entity取得
運転コマンド生成
無線LANモジュール
マイコンボード
モータードライバ
速度八十で前に進め
一番ポイントを右へ
FlashAir Developers Summit
Microsoft Cognitive Services
 さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
FlashAir Developers Summit
Microsoft Cognitive Services
 Bing Speech API(音声認識) https://www.microsoft.com/cognitive-services/en-us/speech-api
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
FlashAir Developers Summit
Microsoft Cognitive Services
 Bing Speech API – Speech Recognition機能
 音声データをもとに、文字情報を認識する機能。
 PCM single channel、Siren、SirenSR形式に対応
 REST API
 Http MethodでPOSTするだけで、JSON形式で音声認識した文
字データを取得できる
 無料利用可能
 1ヵ月5,000リクエストまで
 機能ごとに20リクエスト/分まで
 全機能で60リクエスト/分まで
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
FlashAir Developers Summit
Microsoft Cognitive Services
 Bing Speech API – Speech Recognition機能
 対応言語
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
language-
Country
English Name language-
Country
English Name language-
Country
English Name language-
Country
English Name
ar-EG* Arabic (Egypt) en-IN English (India) fr-FR French(France) pt-BR Portuguese(Brazil)
ca-ES Catalan(Spain) en-NZ
English (New
Zealand)
it-IT Italian(Italy) pt-PT
Portuguese(Portug
al)
da-DK Danish(Denmark) en-US
English (United
States)
ja-JP Japanese(Japan) ru-RU Russian(Russia)
de-DE German(Germany) es-ES Spanish(Spain) ko-KR Korean (Korea) sv-SE Swedish(Sweden)
en-AU English(Australia) es-MX Spanish (Mexico) nb-NO
Norwegian-Bokmal
(Norway)
zh-CN Chinese (China)
en-CA English(Canada) fi-FI Finnish(Finland) nl-NL Dutch(Netherlands) zh-HK
Chinese (Hong
Kong SAR)
en-GB
English(United
Kingdom) fr-CA French(Canada) pl-PL Polish(Poland) zh-TW Chinese (Taiwan)
*ar-EG supports Modern Standard Arabic (MSA)
FlashAir Developers Summit
Microsoft Cognitive Services
 さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
FlashAir Developers Summit
LUIS – Intent設定画面
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 23
FlashAir Developers Summit
LUIS – 学習状況確認画面
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 24
FlashAir Developers Summit
LUIS – 文章認識例
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 25
一番ポイントを右へ
速度八十で前に進め
Entityの認識:
pointNumber「一番」
pointDirection「右」
Intentの認識:
ポイント制御用文章と認識
Intentの認識:
電車制御用文章と認識
Entityの認識:
trainSpeed「八十」
trainDirection「前」
FlashAir Developers Summit
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 26
というわけで、
とても簡単に使えるので
FlashAirで
Cognitive Servicesを使って
いろいろ試してみてください!
FlashAir Developers Summit
2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 27
ご静聴ありがとうございました

Mais conteúdo relacionado

Mais procurados

Power platform day summer '20 Power Automate のエラーに向き合ってみよう
Power platform day summer '20 Power Automate のエラーに向き合ってみようPower platform day summer '20 Power Automate のエラーに向き合ってみよう
Power platform day summer '20 Power Automate のエラーに向き合ってみようssuser6e9dab
 
Microsoft Flow 改め、Power Automateはじめました。
Microsoft Flow 改め、Power Automateはじめました。Microsoft Flow 改め、Power Automateはじめました。
Microsoft Flow 改め、Power Automateはじめました。典子 松本
 
20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみよう
20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみよう20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみよう
20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみようta2c
 
ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -
ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -
ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -典子 松本
 
2015 11 05_ios9_新仕様まとめ_社内勉強会
2015 11 05_ios9_新仕様まとめ_社内勉強会2015 11 05_ios9_新仕様まとめ_社内勉強会
2015 11 05_ios9_新仕様まとめ_社内勉強会Natsuki Yamanaka
 
20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」
20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」
20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」Yusuke KUROIWA
 
AppStore申請を一式まるっと自動化する
AppStore申請を一式まるっと自動化するAppStore申請を一式まるっと自動化する
AppStore申請を一式まるっと自動化するTomoki Hasegawa
 
junaioで楽しもうAR
junaioで楽しもうARjunaioで楽しもうAR
junaioで楽しもうARYouhei Iwasaki
 
20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナー20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナーkdl_yamanaka
 
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジmixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジShinya Okano
 
デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?
デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?
デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?SORACOM,INC
 
はじめてのiOSアプリ開発 Swift対応版
はじめてのiOSアプリ開発 Swift対応版はじめてのiOSアプリ開発 Swift対応版
はじめてのiOSアプリ開発 Swift対応版Tomoki Hasegawa
 
国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」
国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」 国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」
国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」 Hayato Ito
 
[社内向け]Titanium勉強会
[社内向け]Titanium勉強会[社内向け]Titanium勉強会
[社内向け]Titanium勉強会Rei Matsushita
 
AWSを用いた番組連動Webコンテンツ処理基盤の構築
AWSを用いた番組連動Webコンテンツ処理基盤の構築AWSを用いた番組連動Webコンテンツ処理基盤の構築
AWSを用いた番組連動Webコンテンツ処理基盤の構築Eiji KOMINAMI
 
PHPでスマホアプリにプッシュ通知する
PHPでスマホアプリにプッシュ通知するPHPでスマホアプリにプッシュ通知する
PHPでスマホアプリにプッシュ通知するTomoki Hasegawa
 

Mais procurados (20)

Power platform day summer '20 Power Automate のエラーに向き合ってみよう
Power platform day summer '20 Power Automate のエラーに向き合ってみようPower platform day summer '20 Power Automate のエラーに向き合ってみよう
Power platform day summer '20 Power Automate のエラーに向き合ってみよう
 
Scc2013 air
Scc2013 airScc2013 air
Scc2013 air
 
Microsoft Flow 改め、Power Automateはじめました。
Microsoft Flow 改め、Power Automateはじめました。Microsoft Flow 改め、Power Automateはじめました。
Microsoft Flow 改め、Power Automateはじめました。
 
20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみよう
20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみよう20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみよう
20200829 Ctrl+Alt+BとスマホタッチでPower Automateのフローを実行してみよう
 
Rancher on Bluemix Infrastructure
Rancher on Bluemix InfrastructureRancher on Bluemix Infrastructure
Rancher on Bluemix Infrastructure
 
ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -
ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -
ノンコーディングでやってみよう!音声テキスト変換 - LINE × Logic Apps × Speech to text -
 
2015 11 05_ios9_新仕様まとめ_社内勉強会
2015 11 05_ios9_新仕様まとめ_社内勉強会2015 11 05_ios9_新仕様まとめ_社内勉強会
2015 11 05_ios9_新仕様まとめ_社内勉強会
 
20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」
20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」
20160820 iOSDC Lunch Session「東急ハンズのPOSから学んだ、業務iOSアプリの向き合い方」
 
AppStore申請を一式まるっと自動化する
AppStore申請を一式まるっと自動化するAppStore申請を一式まるっと自動化する
AppStore申請を一式まるっと自動化する
 
junaioで楽しもうAR
junaioで楽しもうARjunaioで楽しもうAR
junaioで楽しもうAR
 
20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナー20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナー
 
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジmixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
 
デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?
デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?
デブサミ関西 2017| IoTビジネスが もっと発展するために必要なものとは?
 
はじめてのiOSアプリ開発 Swift対応版
はじめてのiOSアプリ開発 Swift対応版はじめてのiOSアプリ開発 Swift対応版
はじめてのiOSアプリ開発 Swift対応版
 
I phone5 ios6
I phone5 ios6I phone5 ios6
I phone5 ios6
 
国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」
国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」 国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」
国内Cloud spanner初事例!「迎車料金無し!新感覚タクシーアプリ「フルクル」」
 
[社内向け]Titanium勉強会
[社内向け]Titanium勉強会[社内向け]Titanium勉強会
[社内向け]Titanium勉強会
 
AWSを用いた番組連動Webコンテンツ処理基盤の構築
AWSを用いた番組連動Webコンテンツ処理基盤の構築AWSを用いた番組連動Webコンテンツ処理基盤の構築
AWSを用いた番組連動Webコンテンツ処理基盤の構築
 
PHPでスマホアプリにプッシュ通知する
PHPでスマホアプリにプッシュ通知するPHPでスマホアプリにプッシュ通知する
PHPでスマホアプリにプッシュ通知する
 
About Titanium Mobile
About Titanium MobileAbout Titanium Mobile
About Titanium Mobile
 

Semelhante a FlashAirとCognitive Servicesを使おう!

FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!FlashAirデベロッパーズ
 
Web is the OS (Firefox OS)
Web is the OS (Firefox OS)Web is the OS (Firefox OS)
Web is the OS (Firefox OS)dynamis
 
InterBEE 2018 AWS & AWS Elemental Booth Review
InterBEE 2018 AWS & AWS Elemental Booth ReviewInterBEE 2018 AWS & AWS Elemental Booth Review
InterBEE 2018 AWS & AWS Elemental Booth ReviewAmazon Web Services Japan
 
Attractive HTML5
Attractive HTML5Attractive HTML5
Attractive HTML5Sho Ito
 
Firefox Marketplace and Payment
Firefox Marketplace and PaymentFirefox Marketplace and Payment
Firefox Marketplace and Paymentdynamis
 
Computer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみたComputer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみたYoshito Tabuchi
 
技術選択とアーキテクトの役割
技術選択とアーキテクトの役割技術選択とアーキテクトの役割
技術選択とアーキテクトの役割Toru Yamaguchi
 
HTML5 in Firefox4
HTML5 in Firefox4HTML5 in Firefox4
HTML5 in Firefox4dynamis
 
2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalk2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalkShozo Okada
 
2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalk2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalkShozo Okada
 
Basis of Firefox Apps
Basis of Firefox AppsBasis of Firefox Apps
Basis of Firefox Appsdynamis
 
Adobe flash platform update 2010/11/17
Adobe flash platform update 2010/11/17Adobe flash platform update 2010/11/17
Adobe flash platform update 2010/11/17Keisuke Todoroki
 
Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5Sho Ito
 
【IVS CTO Night & Day】AWS re:Invent 2017 振り返り
【IVS CTO Night & Day】AWS re:Invent 2017 振り返り【IVS CTO Night & Day】AWS re:Invent 2017 振り返り
【IVS CTO Night & Day】AWS re:Invent 2017 振り返りAmazon Web Services Japan
 
決済金融から始めるデータドリブンカンパニー
決済金融から始めるデータドリブンカンパニー決済金融から始めるデータドリブンカンパニー
決済金融から始めるデータドリブンカンパニーTokuhiro Eto
 
Programming AWS with Python
Programming AWS with Python  Programming AWS with Python
Programming AWS with Python Yasuhiro Matsuo
 

Semelhante a FlashAirとCognitive Servicesを使おう! (20)

[Japan Tech summit 2017] CLD 005
[Japan Tech summit 2017]  CLD 005[Japan Tech summit 2017]  CLD 005
[Japan Tech summit 2017] CLD 005
 
[FlashAir Developers Summit] FlashAirの紹介
[FlashAir Developers Summit] FlashAirの紹介[FlashAir Developers Summit] FlashAirの紹介
[FlashAir Developers Summit] FlashAirの紹介
 
FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!
 
Web is the OS (Firefox OS)
Web is the OS (Firefox OS)Web is the OS (Firefox OS)
Web is the OS (Firefox OS)
 
InterBEE 2018 AWS & AWS Elemental Booth Review
InterBEE 2018 AWS & AWS Elemental Booth ReviewInterBEE 2018 AWS & AWS Elemental Booth Review
InterBEE 2018 AWS & AWS Elemental Booth Review
 
Attractive HTML5
Attractive HTML5Attractive HTML5
Attractive HTML5
 
Firefox Marketplace and Payment
Firefox Marketplace and PaymentFirefox Marketplace and Payment
Firefox Marketplace and Payment
 
Yahoo!ブラウザーにおける市場環境の分析と戦略化
Yahoo!ブラウザーにおける市場環境の分析と戦略化Yahoo!ブラウザーにおける市場環境の分析と戦略化
Yahoo!ブラウザーにおける市場環境の分析と戦略化
 
Computer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみたComputer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみた
 
技術選択とアーキテクトの役割
技術選択とアーキテクトの役割技術選択とアーキテクトの役割
技術選択とアーキテクトの役割
 
HTML5 in Firefox4
HTML5 in Firefox4HTML5 in Firefox4
HTML5 in Firefox4
 
2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalk2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalk
 
2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalk2011_9_9_AIR_LightningTalk
2011_9_9_AIR_LightningTalk
 
決済金融から始めるデータドリブンカンパニー #yjmu
決済金融から始めるデータドリブンカンパニー #yjmu決済金融から始めるデータドリブンカンパニー #yjmu
決済金融から始めるデータドリブンカンパニー #yjmu
 
Basis of Firefox Apps
Basis of Firefox AppsBasis of Firefox Apps
Basis of Firefox Apps
 
Adobe flash platform update 2010/11/17
Adobe flash platform update 2010/11/17Adobe flash platform update 2010/11/17
Adobe flash platform update 2010/11/17
 
Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5
 
【IVS CTO Night & Day】AWS re:Invent 2017 振り返り
【IVS CTO Night & Day】AWS re:Invent 2017 振り返り【IVS CTO Night & Day】AWS re:Invent 2017 振り返り
【IVS CTO Night & Day】AWS re:Invent 2017 振り返り
 
決済金融から始めるデータドリブンカンパニー
決済金融から始めるデータドリブンカンパニー決済金融から始めるデータドリブンカンパニー
決済金融から始めるデータドリブンカンパニー
 
Programming AWS with Python
Programming AWS with Python  Programming AWS with Python
Programming AWS with Python
 

FlashAirとCognitive Servicesを使おう!

  • 1. FlashAir Developers Summit FlashAirとCognitive Servicesを使おう! 2017年2月19日 綾瀬 ヒロ Twitter @ayasehiro 2017/2/19 1All rights reserved. Copyright(C) 2017 AYASE Hiro FlashAir Developers Summit
  • 2. FlashAir Developers Summit 1.自己紹介  綾瀬 ヒロ Twitter:@ayasehiro FlashAirエバンジェリスト(自称) 2017/2/19 2All rights reserved. Copyright(C) 2017 AYASE Hiro 運輸サービス系インダストリーマネージャです(元鉄道系SE) 趣味で庭園鉄道の建設をしていたりします。昔、Mac用フリーソフト「何かon 林檎」を作っていました。 Arduino/FlashAir/Xamarin/鉄道模型 Qiita: http://qiita.com/ayasehiro MakersHub: https://makershub.jp/ayasehiro
  • 3. FlashAir Developers Summit 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 3 本発表内容は、個人の見解であり、 所属する組織の公式見解ではありません。
  • 4. FlashAir Developers Summit 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 4 作例1) 人物カウンター
  • 5. FlashAir Developers Summit 作例1)人物カウンター 全体概要 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 5 Microsoft Cognitive Services Face API (顔認識) 人数・年齢・性別を認識 画像ファイル 画像ファイル 画像ファイル 画像ファイル 画像ファイルの送信 60秒待機 年齢層別・男女別 人数カウント 最終更新日時の 画像ファイルを検索 60秒周期に 写真を撮影 実行スクリプト(Lua) FlashAir IoT Hubに データ送信
  • 6. FlashAir Developers Summit Microsoft Cognitive Services  さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/ 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 7. FlashAir Developers Summit Microsoft Cognitive Services  Computer Vision API – 画像分析機能 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 7
  • 8. FlashAir Developers Summit Microsoft Cognitive Services  Computer Vision API – 画像分析機能(タグ・キャプション等) 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 8
  • 9. FlashAir Developers Summit Microsoft Cognitive Services  Computer Vision API – Describe Image機能  画像データをもとに、タグ(属性)情報とキャプション(説明文)を自動生成する機能。  JPEG, PNG, GIF, BMP形式に対応  4MBまで  50x50ピクセル以上が必要  REST API  Http MethodでPOSTするだけで、JSON形式でタグ・キャプション等の情報を取得できる  無料利用可能  1分間20リクエストまで  1ヵ月5,000リクエストまで 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 9 Http Method POST Request URL https://api.projectoxford.ai/vision/v1.0/describe[?maxCandidates] Request parameters maxCandidates (optional) Maximum number of candidate descriptions to be returned. The default is 1. Request headers Content-Type (optional) Media type of the body sent to the API. Ocp-Apim-Subscription-Key Subscription key which provides access to this API. Found in your subscriptions.
  • 10. FlashAir Developers Summit 作例1)人物カウンター  Computer Vision API – Faces機能を利用 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 10 Faces : JSONメッセージ [ { "age": 28, "gender": "Male", "faceRectangle": { "left": 744, "top": 338, "width": 305, "height": 305 } } ]
  • 11. FlashAir Developers Summit 作例1)人物カウンター  Luaスクリプト例 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 11 boundary = "1234567890" contenttype = "multipart/form-data; boundary=" .. boundary mes = "--" .. boundary .. "¥r¥n" .."Content-Disposition: form-data; name=¥"file¥"; filename=¥""..last_fname.."¥"¥r¥n" .."Content-Type: image/jpg¥r¥n¥r¥n" .."<!--WLANSDFILE-->¥r¥n" .."--" .. boundary .. "--¥r¥n" blen = lfs.attributes(last_fpath,"size") + string.len(mes) - 17 b, c, h = fa.request{url = "https://westus.api.cognitive.microsoft.com/vision/v1.0/analyze?visualFeatures=Faces", method = "POST", headers = {["Content-Length"] = tostring(blen), ["Content-Type"] = contenttype, [“Ocp-Apim-Subscription-Key”] = “ここにサブスクリプションキーを記述する", ["maxCandidates"] = "1"}, file = last_fpath, body = mes }
  • 12. FlashAir Developers Summit 作例1)人物カウンター  Luaスクリプト例 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 12 cjson = require "cjson” if(c == 200) then res = cjson.decode(b) for idx=1,#res.faces do local agenum = tonumber(res.faces[idx].age) if(agenum < 20) then faces_num_00 = faces_num_00 + 1 elseif(agenum >= 20 and agenum < 60) then faces_num_20 = faces_num_20 + 1 elseif(agenum >= 60) then faces_num_60 = faces_num_60 + 1 end if( res.faces[idx].gender == "Female" ) then faces_num_female = faces_num_female + 1 else faces_num_male = faces_num_male + 1 end end end
  • 13. FlashAir Developers Summit 作例1)人物カウンター  Luaスクリプト例 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 13 iothub = require("iothub") iothub.addMeasurement({ faces_num_00, faces_num_20, faces_num_60, faces_num_male, faces_num_female })
  • 14. FlashAir Developers Summit 作例1)人物カウンター 詳しくは・・・  Qiitaの記事を参照ください。 http://qiita.com/ayasehiro/items/9651e1231951766fbe12 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 14
  • 15. FlashAir Developers Summit 作例1)人物カウンター 全体概要 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 15 Microsoft Cognitive Services Conputer Vision API (顔認識) 人数・年齢・性別を認識 画像ファイル 画像ファイル 画像ファイル 画像ファイル 画像ファイルの送信 60秒待機 年齢層別・男女別 人数カウント 最終更新日時の 画像ファイルを検索 60秒周期に 写真を撮影 実行スクリプト(Lua) FlashAir IoT Hubに データ送信 Azure IoT Hub Stream Analytics Azure IoT Hub +Stream Analytics +Power BI でもできるんだからね!
  • 16. FlashAir Developers Summit 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 16 作例2) 音声で鉄道模型を運転
  • 17. FlashAir Developers Summit iOSアプリ powered by Xamarin 作例2)音声で鉄道模型を運転 全体概要 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 17 Microsoft Cognitive Services Bing Speech API (音声認識) LUIS - Language Understanding Intelligent Service (自然言語認識) 音 声 録 音 文字列取得・送信 PWM出力 ポイント制御 Intent・Entity取得 運転コマンド生成 無線LANモジュール マイコンボード モータードライバ 速度八十で前に進め 一番ポイントを右へ
  • 18. FlashAir Developers Summit Microsoft Cognitive Services  さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/ 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 19. FlashAir Developers Summit Microsoft Cognitive Services  Bing Speech API(音声認識) https://www.microsoft.com/cognitive-services/en-us/speech-api 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 20. FlashAir Developers Summit Microsoft Cognitive Services  Bing Speech API – Speech Recognition機能  音声データをもとに、文字情報を認識する機能。  PCM single channel、Siren、SirenSR形式に対応  REST API  Http MethodでPOSTするだけで、JSON形式で音声認識した文 字データを取得できる  無料利用可能  1ヵ月5,000リクエストまで  機能ごとに20リクエスト/分まで  全機能で60リクエスト/分まで 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 21. FlashAir Developers Summit Microsoft Cognitive Services  Bing Speech API – Speech Recognition機能  対応言語 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro language- Country English Name language- Country English Name language- Country English Name language- Country English Name ar-EG* Arabic (Egypt) en-IN English (India) fr-FR French(France) pt-BR Portuguese(Brazil) ca-ES Catalan(Spain) en-NZ English (New Zealand) it-IT Italian(Italy) pt-PT Portuguese(Portug al) da-DK Danish(Denmark) en-US English (United States) ja-JP Japanese(Japan) ru-RU Russian(Russia) de-DE German(Germany) es-ES Spanish(Spain) ko-KR Korean (Korea) sv-SE Swedish(Sweden) en-AU English(Australia) es-MX Spanish (Mexico) nb-NO Norwegian-Bokmal (Norway) zh-CN Chinese (China) en-CA English(Canada) fi-FI Finnish(Finland) nl-NL Dutch(Netherlands) zh-HK Chinese (Hong Kong SAR) en-GB English(United Kingdom) fr-CA French(Canada) pl-PL Polish(Poland) zh-TW Chinese (Taiwan) *ar-EG supports Modern Standard Arabic (MSA)
  • 22. FlashAir Developers Summit Microsoft Cognitive Services  さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/ 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 23. FlashAir Developers Summit LUIS – Intent設定画面 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 23
  • 24. FlashAir Developers Summit LUIS – 学習状況確認画面 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 24
  • 25. FlashAir Developers Summit LUIS – 文章認識例 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 25 一番ポイントを右へ 速度八十で前に進め Entityの認識: pointNumber「一番」 pointDirection「右」 Intentの認識: ポイント制御用文章と認識 Intentの認識: 電車制御用文章と認識 Entityの認識: trainSpeed「八十」 trainDirection「前」
  • 26. FlashAir Developers Summit 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 26 というわけで、 とても簡単に使えるので FlashAirで Cognitive Servicesを使って いろいろ試してみてください!
  • 27. FlashAir Developers Summit 2017/2/19All rights reserved. Copyright(C) 2017 AYASE Hiro 27 ご静聴ありがとうございました