SlideShare a Scribd company logo
1 of 40
Download to read offline
Xamarin.Formsでも
Cognitive Servicesを使おう!
2016年10月15日
綾瀬 ヒロ
Twitter @ayasehiro
JXUGC #17 お前の Xamarin アプリを見せてみろ!
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
自己紹介
u 綾瀬 ヒロ
Twitter:@ayasehiro
FlashAirエバンジェリスト(自称)
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
運輸サービス系インダストリーマネージャです(元鉄道系SE)
趣味で庭園鉄道の建設をしていたりします。
昔、Mac用フリーソフト「何かon林檎」を作っていました。
Arduino/FlashAir/Xamarin/鉄道模型
Qiita: http://qiita.com/ayasehiro
MakersHub: https://makershub.jp/ayasehiro
目次
1. Cognitive Servicesについて
2. MS Translator APIについて
3. アプリケーション例
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
本発表内容は、個人の見解であり、
所属する組織の公式見解ではありません。
これまでこんなアプリを作りましたが……
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
鉄道模型ミニレイアウトの
運転⽤アプリ
(FlashAir対応版)
Gゲージ⼤型鉄道模型の庭園鉄道
運転⽤アプリ
(FlashAir対応版)
Microsoft Cognitive Services
Computer Vision API - Analyzeを
使った
「しゃべるデジカメ スマフォ版」
今回は、こんなの作りました!
「しゃべる翻訳アプリ OCR/音声認識版」
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
JXUGC #17 お前の Xamarinアプリを見せてみろ!
Microsoft Cognitive ServicesのComputer Vision API及び
Bing Speech APIを使った翻訳アプリ
1.Cognitive Servicesについて
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Computer Vision API – 画像分析機能
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Computer Vision API – 画像分析機能(タグ・キャプション等)
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Computer Vision API – 画像分析機能(有名人検索)
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Computer Vision API – 画像分析機能(文字認識 OCR)
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Computer Vision API – 画像分析機能(サムネイル生成)
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Computer Vision API – Analyze機能
u 画像データをもとに、タグ(属性)情報とキャプション(説明文)を自動生成する機能。
u JPEG, PNG, GIF, BMP形式に対応
u 4MBまで
u 50x50ピクセル以上が必要
u REST API
u Http MethodでPOSTするだけで、JSON形式でタグ・キャプション等の情報を取得できる
u 無料利用可能
u 1分間20リクエストまで
u 1ヵ月5,000リクエストまで
Http Method POST
Request URL https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Description,Tags
[&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.
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Computer Vision API – OCR機能
u 画像データをもとに、文字情報を読み取る(OCR)機能。
u JPEG, PNG, GIF, BMP形式に対応
u 4MBまで
u 40x40~3200x3200ピクセルの間、100Mピクセル以内
u REST API
u Http MethodでPOSTするだけで、JSON形式でタグ・キャプション等の情報を取得できる
u 無料利用可能
u 1分間20リクエストまで
u 1ヵ月5,000リクエストまで
Http Method POST
Request URL https://api.projectoxford.ai/vision/v1.0/ocr[?language][&detectOrientation ]
Request parameters language (optional) The BCP-47 language code of the text to be detected in the
image.The default value is "unk", then the service will auto
detect the language of the text in the image.
detectOrientation(optional) Whether detect the text orientation in the image. With
detectOrientation=true the OCR service tries to detect the
image orientation and correct it before further processing
(e.g. if it's upside-down).
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.
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Bing Speech API(音声認識) https://www.microsoft.com/cognitive-services/en-us/speech-api
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Bing Speech API – Speech Recognition機能
u 音声データをもとに、文字情報を認識する機能。
uPCM single channel、Siren、SirenSR形式に対応
u REST API
uHttp MethodでPOSTするだけで、JSON形式で音声認識した
文字データを取得できる
u 無料利用可能
u1ヵ月5,000リクエストまで
u機能ごとに20リクエスト/分まで
u全機能で60リクエスト/分まで
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Cognitive Services
u Bing Speech API – Speech Recognition機能
u 対応言語
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(Braz
il)
ca-ES Catalan(Spain) en-NZ
English (New
Zealand)
it-IT Italian(Italy) pt-PT
Portuguese(Por
tugal)
da-DK
Danish(Denma
rk)
en-US
English (United
States)
ja-JP
Japanese(Japa
n)
ru-RU Russian(Russia)
de-DE
German(Germa
ny)
es-ES Spanish(Spain) ko-KR Korean (Korea) sv-SE
Swedish(Swede
n)
en-AU
English(Australia
)
es-MX
Spanish
(Mexico)
nb-NO
Norwegian-
Bokmal (Norway)
zh-CN
Chinese
(China)
en-CA
English(Canad
a) fi-FI Finnish(Finland) nl-NL
Dutch(Netherlan
ds)
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)
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
2.Translator APIについて
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Translator API
u 翻訳APIが公開されている https://www.microsoft.com/en-us/translator/default.aspx
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Translator API
u Microsoft Translator - Text Translation API
u 指定した文字列を、指定した言語Aから言語Bに翻訳する機能。
u REST API(HTTP Interfaceの例)
uHttp MethodでPOSTするだけで、翻訳結果を得られる。
u 無料利用可能
u1ヵ月2,000,000文字まで
Http Method GET / POST
Request URL http://api.microsofttranslator.com/v2/Http.svc/Translate?text=“翻訳したい文字列(エンコード要)"&from="言
語A”&to="言語B"
Request headers Content-Type (optional) Media type of the body sent to the API.
Authorization Subscription key which provides access to this API. Found in
your subscriptions.
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
Microsoft Translator API
u Microsoft Translator - Text Translation API
u 対応言語(2016年6月現在)
Language Code English Name Language Code English Name Language Code English Name
af Afrikaans ht Haitian Creole fa Persian
ar Arabic he Hebrew pl Polish
bs-Latn Bosnian (Latin) hi Hindi pt Portuguese
bg Bulgarian mww Hmong Daw otq Querétaro Otomi
ca Catalan hu Hungarian ro Romanian
zh-CHS Chinese Simplified id Indonesian ru Russian
zh-CHT Chinese Traditional it Italian sr-Cyrl Serbian (Cyrillic)
hr Croatian ja Japanese sr-Latn Serbian (Latin)
cs Czech sw Kiswahili sk Slovak
da Danish tlh Klingon sl Slovenian
nl Dutch tlh-Qaak Klingon (pIqaD) es Spanish
en English ko Korean sv Swedish
et Estonian lv Latvian th Thai
fi Finnish lt Lithuanian tr Turkish
fr French ms Malay uk Ukrainian
de German mt Maltese ur Urdu
el Greek no Norwegian vi Vietnamese
cy Welsh yua Yucatec Maya2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
3.アプリケーション例(1)
Microsoft Cognitive Services
Computer Vision API - Analyzeを使った
「しゃべるデジカメ スマフォ版」
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
(1)しゃべるデジカメ スマフォ版
u Computer Vision API – Describe Image機能を使って
スマートフォン内蔵カメラで撮影した写真に、
自動キャプション付けを行い、キャプション(英語)を日本語に翻訳し、
合成音声で発生する。
画像ファイル 画像ファイルの送信
テキストファイル受信
写真撮影
XamarinApp
合成音声発生
Computer Vision API
Describe Image機能
Microsoft Azure
”a cat is
sitting in
the grass”
a cat is sitting in the grass
MS Translator API
テキストファイル翻訳
テキストファイル生成
a cat is sitting in the grass
草の上に座っている猫
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
合成音声で発声
”a cat is sitting in the grass”
草の上に座っている猫
”a cat is sitting in the grass”
草の上に座っている猫
(1)しゃべるデジカメ スマフォ版
u Vision API - AnalyzeをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
public async Task<String> getCaptionFromPhoto(String filename, byte[] image) {
String urlString =
"https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Description,Tags";
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", tokenVisionAPI);
httpClient.DefaultRequestHeaders.Add("maxCandidates", "1");
String boundary = "1234567890";
var content = new MultipartFormDataContent(boundary);
content.Add(new StreamContent(new MemoryStream(image)), filename, filename);
HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content);
String result = aResponse.Content.ReadAsStringAsync().Result;
return result;
}
(1)しゃべるデジカメ スマフォ版
u Vision API - AnalyzeをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
https://www.microsoft.com/cognitive-services/en-US/subscriptions
tokenVisionAPI
3.アプリケーション例(2)
Microsoft Cognitive Services
Computer Vision API - OCRを使った
「しゃべる翻訳アプリ OCR版」
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
(2)しゃべる翻訳アプリ OCR版
u Computer Vision API – OCR機能を使ってスマートフォン内蔵カメラで
撮影した写真をOCRして、読み取った文字列を翻訳し、合成音声で発生する。
(対応パターン:自動判別→日本語、日本語→英語)
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
画像ファイル 画像ファイルの送信
テキストファイル受信
写真撮影
XamarinApp
合成音声発生
Computer Vision API
OCR機能
Microsoft Azure
Inhaltsverzeichnis…
MS Translator API
テキストファイル翻訳
テキストファイル生成
⽬次…
合成音声で発声
”a cat is sitting in the grass”
草の上に座っている猫
Inhaltsverzeichnis…
(2)しゃべる翻訳アプリ OCR版
u Vision API - OCRをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
public async Task<String> getOCRFromPhoto(String filename, byte[] image) {
String urlString = "https://api.projectoxford.ai/vision/v1.0/ocr?Ja";
String boundary = "1234567890";
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", tokenVisionAPI);
var content = new MultipartFormDataContent(boundary);
content.Add(new StreamContent(new MemoryStream(image)), filename, filename);
HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content);
String result = aResponse.Content.ReadAsStringAsync().Result;
String str = "";
RootClass rc = JsonConvert.DeserializeObject<RootClass>(result);
for (int idx = 0; idx < rc.regions.Length; idx++)
for (int idx2 = 0; idx2 < rc.regions[idx].lines.Length; idx2++)
for (int idx3 = 0; idx3 < rc.regions[idx].lines[idx2].words.Length; idx3++)
str += rc.regions[idx].lines[idx2].words[idx3].text;
return str;
}
(2)しゃべる翻訳アプリ OCR版
u Vision API - OCRをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
[Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)]
public partial class RootClass {
[Newtonsoft.Json.JsonPropertyAttribute()] public string language;
[Newtonsoft.Json.JsonPropertyAttribute()] public double textAngle;
[Newtonsoft.Json.JsonPropertyAttribute()] public string orientation;
[Newtonsoft.Json.JsonPropertyAttribute()] public Regions[] regions;
}
[Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)]
public partial class Regions{
[Newtonsoft.Json.JsonPropertyAttribute()] public string boundingBox;
[Newtonsoft.Json.JsonPropertyAttribute()] public Lines[] lines;
}
[Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)]
public partial class Lines{
[Newtonsoft.Json.JsonPropertyAttribute()] public string boundingBox;
[Newtonsoft.Json.JsonPropertyAttribute()] public Words[] words;
}
[Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)]
public partial class Words {
[Newtonsoft.Json.JsonPropertyAttribute()] public string boundingBox;
[Newtonsoft.Json.JsonPropertyAttribute()] public string text;
}
3.アプリケーション例(3)
Microsoft Cognitive Services
Bing Speech APIを使った
「しゃべる翻訳アプリ 音声認識版」
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
(3)しゃべる翻訳アプリ 音声認識版
u Vision API - OCRをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
https://www.microsoft.com/cognitive-services/en-US/subscriptions
tokenVisionAPI
(3)しゃべる翻訳アプリ 音声認識版
u Bing Speech API – Speech Recognition機能を使ってスマートフォンで
録音した音声を認識して、認識した文字列を翻訳し、合成音声でしゃべる。
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
音声ファイル 音声ファイルの送信
テキストファイル受信
音声録音
Xamarin
合成音声発生
Bing Speech API
Speech Recognition機能
Microsoft Azure
合成音声で発声
MS Translator API
テキストファイル翻訳
テキストファイル生成
♪「この電⾞は空港に⾏きますか?」
「この電⾞は空港に⾏きますか? 」
「この電⾞は空港に⾏きますか? 」
「Does this train go to the airport?」
♪「この電⾞は空港に⾏きますか? 」
音声を録音
♪ 「Does this train go to
the airport?」
(3)しゃべる翻訳アプリ 音声認識版
u Bing Speech API – Speech Recognition機能を使ってスマートフォンで
録音した音声を認識して、認識した文字列を翻訳し、合成音声でしゃべる。
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
音声ファイル
Bing Speech APIの呼び出し
受信データのJSONパース
Xamarin.Forms
合成音声処理
AVSpeechSynthesizer
Bing Speech API Speech
Recognition機能
Microsoft Azure
MS Translator APITranslator APIの呼び出し
Xamarin.iOS
録音ボタンのPushイベント
(録音開始)
録音ボタンのPushイベント
(録音終了)
録音処理
AVAudioRecorder
録音データ読み込み
MemoryStream形式で引き渡す
Bing Speech APIの
認証トークン生成
Access Token API
Translator APIの
認証トークン生成
Access Token API
受信データのJSONパース
(3)しゃべる翻訳アプリ 音声認識版
u Bing Speech APIをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
public async Task<String> getSpeechToString(String filename, byte[] data) {
String urlString =
"https://speech.platform.bing.com/recognize?version=3.0&appID=D4D52672-91D7-
4C74-8AD8-42B1D98141A5&format=json&device.os=" + Uri.EscapeDataString("iPhone
OS") + "&locale=" + FromLangCode + "&scenarios=ulm"
+ " &requestid=" + speechClientSecret
+ "&instanceid=" + speechClientId;
String token = await getSpeechToTextAccessToken();
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Authorization", token);
var content = new StreamContent(new MemoryStream(data));
content.Headers.TryAddWithoutValidation("Content-Type", "audio/wav;
samplerate=16000");
HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content);
String result = aResponse.Content.ReadAsStringAsync().Result;
var obj = JsonConvert.DeserializeObject<dynamic>(result);
String str = obj["header"]["lexical"].Value;
return str;
}
(3)しゃべる翻訳アプリ 音声認識版
u Bing Speech APIをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
public async Task<String> getSpeechToTextAccessToken() {
String urlString = "https://oxford-speech.cloudapp.net/token/issueToken";
var httpClient = new HttpClient();
var content = new FormUrlEncodedContent(new Dictionary<String, String> {
{ "grant_type", "client_credentials" },
{ "client_id", speechClientId },
{ "client_secret", speechClientSecret },
{ "scope", "https://speech.platform.bing.com" }
});
HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content);
String result = aResponse.Content.ReadAsStringAsync().Result;
var obj= JsonConvert.DeserializeObject<AdmAccessToken>(result);
return "Bearer " + obj.access_token;
}
public class AdmAccessToken {
public string access_token { get; set; }
}
(3)しゃべる翻訳アプリ 音声認識版
u Bing Speech APIをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
https://www.microsoft.com/cognitive-services/en-US/subscriptions
speechClientId
speechClientSecret
(3)しゃべる翻訳アプリ 音声認識版
u MS Translator APIをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
public async Task<String> getTranslatedString(String str, String FromLang, String ToLang) {
String token = await getTranslateAccessToken();
String encstr = Uri.EscapeDataString(str);
String urlString = "http://api.microsofttranslator.com/v2/Http.svc/Translate?text="
+ encstr + "&from=" + FromLang + "&to=" + ToLang;
httpClient.DefaultRequestHeaders.Add("Authorization", token);
HttpResponseMessage aResponse = await httpClient.GetAsync(urlString);
result = aResponse.Content.ReadAsStringAsync().Result;
return rtnstr;
}
(3)しゃべる翻訳アプリ 音声認識版
u MS Translator APIをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
public async Task<String> getTranslateAccessToken() {
String urlString = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13";
var httpClient = new HttpClient();
var content = new FormUrlEncodedContent(new Dictionary<String, String> {
{ "grant_type", "client_credentials" },
{ "client_id", translatorClientId },
{ "client_secret", translatorClientSecret },
{ "scope", "http://api.microsofttranslator.com" }
});
HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content);
String result = aResponse.Content.ReadAsStringAsync().Result;
var obj = JsonConvert.DeserializeObject<AdmAccessToken>(result);
return "Bearer " + obj.access_token;
}
public class AdmAccessToken {
public string access_token { get; set; }
}
(3)しゃべる翻訳アプリ 音声認識版
u MS Translator APIをXamarin.Formsで使う
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
https://datamarket.azure.com/developer/applications
translatorClientId
translatorClientSecret
2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
ご静聴ありがとうございました

More Related Content

What's hot

可能性のデザイン
可能性のデザイン可能性のデザイン
可能性のデザイン力也 伊原
 
junaioで楽しもうAR
junaioで楽しもうARjunaioで楽しもうAR
junaioで楽しもうARYouhei Iwasaki
 
SappoRo.R #3 LT: Shiny by RStudio
SappoRo.R #3 LT: Shiny by RStudioSappoRo.R #3 LT: Shiny by RStudio
SappoRo.R #3 LT: Shiny by RStudioMizumoto Atsushi
 
Power Platform + LINEBRAIN OCR API
Power Platform + LINEBRAIN OCR APIPower Platform + LINEBRAIN OCR API
Power Platform + LINEBRAIN OCR APIssuser6e9dab
 
Xamarin.iOS 開発者から見た Swift
Xamarin.iOS 開発者から見た SwiftXamarin.iOS 開発者から見た Swift
Xamarin.iOS 開発者から見た SwiftTomohiro Suzuki
 
JavaScriptでできる電力使用状況グラフ
JavaScriptでできる電力使用状況グラフJavaScriptでできる電力使用状況グラフ
JavaScriptでできる電力使用状況グラフYuko Toriyama
 
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジmixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジShinya Okano
 
Sakenomyの開発経緯と内容をできるだけ公開しちゃいます
Sakenomyの開発経緯と内容をできるだけ公開しちゃいますSakenomyの開発経緯と内容をできるだけ公開しちゃいます
Sakenomyの開発経緯と内容をできるだけ公開しちゃいますYo Otagawa
 
MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~
MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~
MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~Teruchika Yamada
 
20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナー20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナーkdl_yamanaka
 
20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」
20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」
20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」Yusuke KUROIWA
 
ノンコーディングでここまでできる!LINE BOT を作ってみよう!
ノンコーディングでここまでできる!LINE BOT を作ってみよう!ノンコーディングでここまでできる!LINE BOT を作ってみよう!
ノンコーディングでここまでできる!LINE BOT を作ってみよう!典子 松本
 
APIbank(メディア)からみた国産APIの現実と未来にむけて
APIbank(メディア)からみた国産APIの現実と未来にむけてAPIbank(メディア)からみた国産APIの現実と未来にむけて
APIbank(メディア)からみた国産APIの現実と未来にむけてAPI Meetup
 
[社内向け]Titanium勉強会
[社内向け]Titanium勉強会[社内向け]Titanium勉強会
[社内向け]Titanium勉強会Rei Matsushita
 
シルバーウィークにfacebookアプリを作成した
シルバーウィークにfacebookアプリを作成したシルバーウィークにfacebookアプリを作成した
シルバーウィークにfacebookアプリを作成したShinichi Hirauchi
 

What's hot (15)

可能性のデザイン
可能性のデザイン可能性のデザイン
可能性のデザイン
 
junaioで楽しもうAR
junaioで楽しもうARjunaioで楽しもうAR
junaioで楽しもうAR
 
SappoRo.R #3 LT: Shiny by RStudio
SappoRo.R #3 LT: Shiny by RStudioSappoRo.R #3 LT: Shiny by RStudio
SappoRo.R #3 LT: Shiny by RStudio
 
Power Platform + LINEBRAIN OCR API
Power Platform + LINEBRAIN OCR APIPower Platform + LINEBRAIN OCR API
Power Platform + LINEBRAIN OCR API
 
Xamarin.iOS 開発者から見た Swift
Xamarin.iOS 開発者から見た SwiftXamarin.iOS 開発者から見た Swift
Xamarin.iOS 開発者から見た Swift
 
JavaScriptでできる電力使用状況グラフ
JavaScriptでできる電力使用状況グラフJavaScriptでできる電力使用状況グラフ
JavaScriptでできる電力使用状況グラフ
 
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジmixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
mixiアプリ『the Actress』運用にあたっての課題へのチャレンジ
 
Sakenomyの開発経緯と内容をできるだけ公開しちゃいます
Sakenomyの開発経緯と内容をできるだけ公開しちゃいますSakenomyの開発経緯と内容をできるだけ公開しちゃいます
Sakenomyの開発経緯と内容をできるだけ公開しちゃいます
 
MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~
MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~
MRアプリを Power Apps で爆速開発 ~Low Code で 仮想世界へGo!~
 
20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナー20160621 KDL_monacaソリューションセミナー
20160621 KDL_monacaソリューションセミナー
 
20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」
20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」
20170311 JAWSDAYS Lunch Session「東急ハンズのiPad POS「HandsPOS」と AWSの付き合い方」
 
ノンコーディングでここまでできる!LINE BOT を作ってみよう!
ノンコーディングでここまでできる!LINE BOT を作ってみよう!ノンコーディングでここまでできる!LINE BOT を作ってみよう!
ノンコーディングでここまでできる!LINE BOT を作ってみよう!
 
APIbank(メディア)からみた国産APIの現実と未来にむけて
APIbank(メディア)からみた国産APIの現実と未来にむけてAPIbank(メディア)からみた国産APIの現実と未来にむけて
APIbank(メディア)からみた国産APIの現実と未来にむけて
 
[社内向け]Titanium勉強会
[社内向け]Titanium勉強会[社内向け]Titanium勉強会
[社内向け]Titanium勉強会
 
シルバーウィークにfacebookアプリを作成した
シルバーウィークにfacebookアプリを作成したシルバーウィークにfacebookアプリを作成した
シルバーウィークにfacebookアプリを作成した
 

Similar to Xamarin.FormsでもCognitive Servicesを使おう!

Computer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみたComputer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみたYoshito Tabuchi
 
Speech API の概要(Microsoft Cognitive Services)
Speech API の概要(Microsoft Cognitive Services)Speech API の概要(Microsoft Cognitive Services)
Speech API の概要(Microsoft Cognitive Services)Atsushi Yokohama (BEACHSIDE)
 
Azure App Service Overview LT
Azure App Service Overview LTAzure App Service Overview LT
Azure App Service Overview LTKeiji Kamebuchi
 
Web Audio API と IBM Watson Speech to Text の話
Web Audio API と IBM Watson Speech to Text の話Web Audio API と IBM Watson Speech to Text の話
Web Audio API と IBM Watson Speech to Text の話K Kimura
 
企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発
企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発
企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発Ryohei Sogo
 
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...Amazon Web Services Japan
 
20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~
20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~
20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~ISAO_Corp
 
Pepperで翻訳ソフトを作ってみた
Pepperで翻訳ソフトを作ってみたPepperで翻訳ソフトを作ってみた
Pepperで翻訳ソフトを作ってみたForex Robotics Co., Ltd.
 
Data API + AWS = (CMS どうでしょう 札幌編)
Data API + AWS =  (CMS どうでしょう 札幌編)Data API + AWS =  (CMS どうでしょう 札幌編)
Data API + AWS = (CMS どうでしょう 札幌編)Yuji Takayama
 
#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチ
#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチ#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチ
#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチKazuya Sugimoto
 
チラ見せ! マイソースファクトリーでのAws活用 修正
チラ見せ! マイソースファクトリーでのAws活用 修正チラ見せ! マイソースファクトリーでのAws活用 修正
チラ見せ! マイソースファクトリーでのAws活用 修正Yutaka Fujisaki
 
IBM Blluemix を Pepper とつないでみよう
IBM Blluemix を Pepper とつないでみようIBM Blluemix を Pepper とつないでみよう
IBM Blluemix を Pepper とつないでみようTakuji Kawata
 
Watsonで地図ナビアプリつくってみた
Watsonで地図ナビアプリつくってみたWatsonで地図ナビアプリつくってみた
Watsonで地図ナビアプリつくってみたKota Suizu
 
Hack On Air - Microsoft APIs
Hack On Air - Microsoft APIsHack On Air - Microsoft APIs
Hack On Air - Microsoft APIsKeiji Kamebuchi
 
C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介
C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介
C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介Yoshito Tabuchi
 

Similar to Xamarin.FormsでもCognitive Servicesを使おう! (20)

Computer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみたComputer Vision と Translator Text API 使ってみた
Computer Vision と Translator Text API 使ってみた
 
Speech API の概要(Microsoft Cognitive Services)
Speech API の概要(Microsoft Cognitive Services)Speech API の概要(Microsoft Cognitive Services)
Speech API の概要(Microsoft Cognitive Services)
 
Yahoo!ブラウザーにおける市場環境の分析と戦略化
Yahoo!ブラウザーにおける市場環境の分析と戦略化Yahoo!ブラウザーにおける市場環境の分析と戦略化
Yahoo!ブラウザーにおける市場環境の分析と戦略化
 
Bonfire API #1 APIのリトライ処理
Bonfire API #1 APIのリトライ処理Bonfire API #1 APIのリトライ処理
Bonfire API #1 APIのリトライ処理
 
Azure App Service Overview LT
Azure App Service Overview LTAzure App Service Overview LT
Azure App Service Overview LT
 
Web Audio API と IBM Watson Speech to Text の話
Web Audio API と IBM Watson Speech to Text の話Web Audio API と IBM Watson Speech to Text の話
Web Audio API と IBM Watson Speech to Text の話
 
企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発
企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発
企業向けmBaaS「AppPot」を使ったサーバー開発なしの高速モバイルアプリ開発
 
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...
 
20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~
20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~
20180119 AI で業務効率化 ~B To Employee ではじめる Chat Bot~
 
Pepperで翻訳ソフトを作ってみた
Pepperで翻訳ソフトを作ってみたPepperで翻訳ソフトを作ってみた
Pepperで翻訳ソフトを作ってみた
 
20230425_getsudemy01_Power Platform + Azure Cognitive Serviceを語らせてください!.pdf
20230425_getsudemy01_Power Platform + Azure Cognitive Serviceを語らせてください!.pdf20230425_getsudemy01_Power Platform + Azure Cognitive Serviceを語らせてください!.pdf
20230425_getsudemy01_Power Platform + Azure Cognitive Serviceを語らせてください!.pdf
 
Data API + AWS = (CMS どうでしょう 札幌編)
Data API + AWS =  (CMS どうでしょう 札幌編)Data API + AWS =  (CMS どうでしょう 札幌編)
Data API + AWS = (CMS どうでしょう 札幌編)
 
Fetch apiについて
Fetch apiについてFetch apiについて
Fetch apiについて
 
#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチ
#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチ#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチ
#decode19 #MW04 誰のための API? Azure デベロッパーにもエンド ユーザーにも嬉しいAPI エコシステム活用アプローチ
 
チラ見せ! マイソースファクトリーでのAws活用 修正
チラ見せ! マイソースファクトリーでのAws活用 修正チラ見せ! マイソースファクトリーでのAws活用 修正
チラ見せ! マイソースファクトリーでのAws活用 修正
 
IBM Blluemix を Pepper とつないでみよう
IBM Blluemix を Pepper とつないでみようIBM Blluemix を Pepper とつないでみよう
IBM Blluemix を Pepper とつないでみよう
 
Watsonで地図ナビアプリつくってみた
Watsonで地図ナビアプリつくってみたWatsonで地図ナビアプリつくってみた
Watsonで地図ナビアプリつくってみた
 
Hack On Air - Microsoft APIs
Hack On Air - Microsoft APIsHack On Air - Microsoft APIs
Hack On Air - Microsoft APIs
 
C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介
C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介
C#でのクロスプラットフォーム モバイル開発環境 Xamarin のご紹介
 
GCPの画像認識APIの紹介
GCPの画像認識APIの紹介 GCPの画像認識APIの紹介
GCPの画像認識APIの紹介
 

Recently uploaded

Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 

Recently uploaded (9)

Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 

Xamarin.FormsでもCognitive Servicesを使おう!

  • 1. Xamarin.Formsでも Cognitive Servicesを使おう! 2016年10月15日 綾瀬 ヒロ Twitter @ayasehiro JXUGC #17 お前の Xamarin アプリを見せてみろ! 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 2. 自己紹介 u 綾瀬 ヒロ Twitter:@ayasehiro FlashAirエバンジェリスト(自称) 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro 運輸サービス系インダストリーマネージャです(元鉄道系SE) 趣味で庭園鉄道の建設をしていたりします。 昔、Mac用フリーソフト「何かon林檎」を作っていました。 Arduino/FlashAir/Xamarin/鉄道模型 Qiita: http://qiita.com/ayasehiro MakersHub: https://makershub.jp/ayasehiro
  • 3. 目次 1. Cognitive Servicesについて 2. MS Translator APIについて 3. アプリケーション例 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro 本発表内容は、個人の見解であり、 所属する組織の公式見解ではありません。
  • 4. これまでこんなアプリを作りましたが…… 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro 鉄道模型ミニレイアウトの 運転⽤アプリ (FlashAir対応版) Gゲージ⼤型鉄道模型の庭園鉄道 運転⽤アプリ (FlashAir対応版) Microsoft Cognitive Services Computer Vision API - Analyzeを 使った 「しゃべるデジカメ スマフォ版」
  • 5. 今回は、こんなの作りました! 「しゃべる翻訳アプリ OCR/音声認識版」 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro JXUGC #17 お前の Xamarinアプリを見せてみろ! Microsoft Cognitive ServicesのComputer Vision API及び Bing Speech APIを使った翻訳アプリ
  • 6. 1.Cognitive Servicesについて 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 7. Microsoft Cognitive Services u さまざまなAPIが公開されています。 https://www.microsoft.com/cognitive-services/ 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 8. Microsoft Cognitive Services u Computer Vision API – 画像分析機能 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 9. Microsoft Cognitive Services u Computer Vision API – 画像分析機能(タグ・キャプション等) 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 10. Microsoft Cognitive Services u Computer Vision API – 画像分析機能(有名人検索) 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 11. Microsoft Cognitive Services u Computer Vision API – 画像分析機能(文字認識 OCR) 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 12. Microsoft Cognitive Services u Computer Vision API – 画像分析機能(サムネイル生成) 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 13. Microsoft Cognitive Services u Computer Vision API – Analyze機能 u 画像データをもとに、タグ(属性)情報とキャプション(説明文)を自動生成する機能。 u JPEG, PNG, GIF, BMP形式に対応 u 4MBまで u 50x50ピクセル以上が必要 u REST API u Http MethodでPOSTするだけで、JSON形式でタグ・キャプション等の情報を取得できる u 無料利用可能 u 1分間20リクエストまで u 1ヵ月5,000リクエストまで Http Method POST Request URL https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Description,Tags [&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. 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 14. Microsoft Cognitive Services u Computer Vision API – OCR機能 u 画像データをもとに、文字情報を読み取る(OCR)機能。 u JPEG, PNG, GIF, BMP形式に対応 u 4MBまで u 40x40~3200x3200ピクセルの間、100Mピクセル以内 u REST API u Http MethodでPOSTするだけで、JSON形式でタグ・キャプション等の情報を取得できる u 無料利用可能 u 1分間20リクエストまで u 1ヵ月5,000リクエストまで Http Method POST Request URL https://api.projectoxford.ai/vision/v1.0/ocr[?language][&detectOrientation ] Request parameters language (optional) The BCP-47 language code of the text to be detected in the image.The default value is "unk", then the service will auto detect the language of the text in the image. detectOrientation(optional) Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down). 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. 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 15. Microsoft Cognitive Services u Bing Speech API(音声認識) https://www.microsoft.com/cognitive-services/en-us/speech-api 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 16. Microsoft Cognitive Services u Bing Speech API – Speech Recognition機能 u 音声データをもとに、文字情報を認識する機能。 uPCM single channel、Siren、SirenSR形式に対応 u REST API uHttp MethodでPOSTするだけで、JSON形式で音声認識した 文字データを取得できる u 無料利用可能 u1ヵ月5,000リクエストまで u機能ごとに20リクエスト/分まで u全機能で60リクエスト/分まで 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 17. Microsoft Cognitive Services u Bing Speech API – Speech Recognition機能 u 対応言語 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(Braz il) ca-ES Catalan(Spain) en-NZ English (New Zealand) it-IT Italian(Italy) pt-PT Portuguese(Por tugal) da-DK Danish(Denma rk) en-US English (United States) ja-JP Japanese(Japa n) ru-RU Russian(Russia) de-DE German(Germa ny) es-ES Spanish(Spain) ko-KR Korean (Korea) sv-SE Swedish(Swede n) en-AU English(Australia ) es-MX Spanish (Mexico) nb-NO Norwegian- Bokmal (Norway) zh-CN Chinese (China) en-CA English(Canad a) fi-FI Finnish(Finland) nl-NL Dutch(Netherlan ds) 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) 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 18. 2.Translator APIについて 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 19. Microsoft Translator API u 翻訳APIが公開されている https://www.microsoft.com/en-us/translator/default.aspx 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 20. Microsoft Translator API u Microsoft Translator - Text Translation API u 指定した文字列を、指定した言語Aから言語Bに翻訳する機能。 u REST API(HTTP Interfaceの例) uHttp MethodでPOSTするだけで、翻訳結果を得られる。 u 無料利用可能 u1ヵ月2,000,000文字まで Http Method GET / POST Request URL http://api.microsofttranslator.com/v2/Http.svc/Translate?text=“翻訳したい文字列(エンコード要)"&from="言 語A”&to="言語B" Request headers Content-Type (optional) Media type of the body sent to the API. Authorization Subscription key which provides access to this API. Found in your subscriptions. 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 21. Microsoft Translator API u Microsoft Translator - Text Translation API u 対応言語(2016年6月現在) Language Code English Name Language Code English Name Language Code English Name af Afrikaans ht Haitian Creole fa Persian ar Arabic he Hebrew pl Polish bs-Latn Bosnian (Latin) hi Hindi pt Portuguese bg Bulgarian mww Hmong Daw otq Querétaro Otomi ca Catalan hu Hungarian ro Romanian zh-CHS Chinese Simplified id Indonesian ru Russian zh-CHT Chinese Traditional it Italian sr-Cyrl Serbian (Cyrillic) hr Croatian ja Japanese sr-Latn Serbian (Latin) cs Czech sw Kiswahili sk Slovak da Danish tlh Klingon sl Slovenian nl Dutch tlh-Qaak Klingon (pIqaD) es Spanish en English ko Korean sv Swedish et Estonian lv Latvian th Thai fi Finnish lt Lithuanian tr Turkish fr French ms Malay uk Ukrainian de German mt Maltese ur Urdu el Greek no Norwegian vi Vietnamese cy Welsh yua Yucatec Maya2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 22. 3.アプリケーション例(1) Microsoft Cognitive Services Computer Vision API - Analyzeを使った 「しゃべるデジカメ スマフォ版」 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 23. (1)しゃべるデジカメ スマフォ版 u Computer Vision API – Describe Image機能を使って スマートフォン内蔵カメラで撮影した写真に、 自動キャプション付けを行い、キャプション(英語)を日本語に翻訳し、 合成音声で発生する。 画像ファイル 画像ファイルの送信 テキストファイル受信 写真撮影 XamarinApp 合成音声発生 Computer Vision API Describe Image機能 Microsoft Azure ”a cat is sitting in the grass” a cat is sitting in the grass MS Translator API テキストファイル翻訳 テキストファイル生成 a cat is sitting in the grass 草の上に座っている猫 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro 合成音声で発声 ”a cat is sitting in the grass” 草の上に座っている猫 ”a cat is sitting in the grass” 草の上に座っている猫
  • 24. (1)しゃべるデジカメ スマフォ版 u Vision API - AnalyzeをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro public async Task<String> getCaptionFromPhoto(String filename, byte[] image) { String urlString = "https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Description,Tags"; var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", tokenVisionAPI); httpClient.DefaultRequestHeaders.Add("maxCandidates", "1"); String boundary = "1234567890"; var content = new MultipartFormDataContent(boundary); content.Add(new StreamContent(new MemoryStream(image)), filename, filename); HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content); String result = aResponse.Content.ReadAsStringAsync().Result; return result; }
  • 25. (1)しゃべるデジカメ スマフォ版 u Vision API - AnalyzeをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro https://www.microsoft.com/cognitive-services/en-US/subscriptions tokenVisionAPI
  • 26. 3.アプリケーション例(2) Microsoft Cognitive Services Computer Vision API - OCRを使った 「しゃべる翻訳アプリ OCR版」 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 27. (2)しゃべる翻訳アプリ OCR版 u Computer Vision API – OCR機能を使ってスマートフォン内蔵カメラで 撮影した写真をOCRして、読み取った文字列を翻訳し、合成音声で発生する。 (対応パターン:自動判別→日本語、日本語→英語) 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro 画像ファイル 画像ファイルの送信 テキストファイル受信 写真撮影 XamarinApp 合成音声発生 Computer Vision API OCR機能 Microsoft Azure Inhaltsverzeichnis… MS Translator API テキストファイル翻訳 テキストファイル生成 ⽬次… 合成音声で発声 ”a cat is sitting in the grass” 草の上に座っている猫 Inhaltsverzeichnis…
  • 28. (2)しゃべる翻訳アプリ OCR版 u Vision API - OCRをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro public async Task<String> getOCRFromPhoto(String filename, byte[] image) { String urlString = "https://api.projectoxford.ai/vision/v1.0/ocr?Ja"; String boundary = "1234567890"; var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", tokenVisionAPI); var content = new MultipartFormDataContent(boundary); content.Add(new StreamContent(new MemoryStream(image)), filename, filename); HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content); String result = aResponse.Content.ReadAsStringAsync().Result; String str = ""; RootClass rc = JsonConvert.DeserializeObject<RootClass>(result); for (int idx = 0; idx < rc.regions.Length; idx++) for (int idx2 = 0; idx2 < rc.regions[idx].lines.Length; idx2++) for (int idx3 = 0; idx3 < rc.regions[idx].lines[idx2].words.Length; idx3++) str += rc.regions[idx].lines[idx2].words[idx3].text; return str; }
  • 29. (2)しゃべる翻訳アプリ OCR版 u Vision API - OCRをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro [Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)] public partial class RootClass { [Newtonsoft.Json.JsonPropertyAttribute()] public string language; [Newtonsoft.Json.JsonPropertyAttribute()] public double textAngle; [Newtonsoft.Json.JsonPropertyAttribute()] public string orientation; [Newtonsoft.Json.JsonPropertyAttribute()] public Regions[] regions; } [Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)] public partial class Regions{ [Newtonsoft.Json.JsonPropertyAttribute()] public string boundingBox; [Newtonsoft.Json.JsonPropertyAttribute()] public Lines[] lines; } [Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)] public partial class Lines{ [Newtonsoft.Json.JsonPropertyAttribute()] public string boundingBox; [Newtonsoft.Json.JsonPropertyAttribute()] public Words[] words; } [Newtonsoft.Json.JsonObjectAttribute(MemberSerialization = Newtonsoft.Json.MemberSerialization.OptIn)] public partial class Words { [Newtonsoft.Json.JsonPropertyAttribute()] public string boundingBox; [Newtonsoft.Json.JsonPropertyAttribute()] public string text; }
  • 30. 3.アプリケーション例(3) Microsoft Cognitive Services Bing Speech APIを使った 「しゃべる翻訳アプリ 音声認識版」 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro
  • 31. (3)しゃべる翻訳アプリ 音声認識版 u Vision API - OCRをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro https://www.microsoft.com/cognitive-services/en-US/subscriptions tokenVisionAPI
  • 32. (3)しゃべる翻訳アプリ 音声認識版 u Bing Speech API – Speech Recognition機能を使ってスマートフォンで 録音した音声を認識して、認識した文字列を翻訳し、合成音声でしゃべる。 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro 音声ファイル 音声ファイルの送信 テキストファイル受信 音声録音 Xamarin 合成音声発生 Bing Speech API Speech Recognition機能 Microsoft Azure 合成音声で発声 MS Translator API テキストファイル翻訳 テキストファイル生成 ♪「この電⾞は空港に⾏きますか?」 「この電⾞は空港に⾏きますか? 」 「この電⾞は空港に⾏きますか? 」 「Does this train go to the airport?」 ♪「この電⾞は空港に⾏きますか? 」 音声を録音 ♪ 「Does this train go to the airport?」
  • 33. (3)しゃべる翻訳アプリ 音声認識版 u Bing Speech API – Speech Recognition機能を使ってスマートフォンで 録音した音声を認識して、認識した文字列を翻訳し、合成音声でしゃべる。 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro 音声ファイル Bing Speech APIの呼び出し 受信データのJSONパース Xamarin.Forms 合成音声処理 AVSpeechSynthesizer Bing Speech API Speech Recognition機能 Microsoft Azure MS Translator APITranslator APIの呼び出し Xamarin.iOS 録音ボタンのPushイベント (録音開始) 録音ボタンのPushイベント (録音終了) 録音処理 AVAudioRecorder 録音データ読み込み MemoryStream形式で引き渡す Bing Speech APIの 認証トークン生成 Access Token API Translator APIの 認証トークン生成 Access Token API 受信データのJSONパース
  • 34. (3)しゃべる翻訳アプリ 音声認識版 u Bing Speech APIをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro public async Task<String> getSpeechToString(String filename, byte[] data) { String urlString = "https://speech.platform.bing.com/recognize?version=3.0&appID=D4D52672-91D7- 4C74-8AD8-42B1D98141A5&format=json&device.os=" + Uri.EscapeDataString("iPhone OS") + "&locale=" + FromLangCode + "&scenarios=ulm" + " &requestid=" + speechClientSecret + "&instanceid=" + speechClientId; String token = await getSpeechToTextAccessToken(); var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Add("Authorization", token); var content = new StreamContent(new MemoryStream(data)); content.Headers.TryAddWithoutValidation("Content-Type", "audio/wav; samplerate=16000"); HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content); String result = aResponse.Content.ReadAsStringAsync().Result; var obj = JsonConvert.DeserializeObject<dynamic>(result); String str = obj["header"]["lexical"].Value; return str; }
  • 35. (3)しゃべる翻訳アプリ 音声認識版 u Bing Speech APIをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro public async Task<String> getSpeechToTextAccessToken() { String urlString = "https://oxford-speech.cloudapp.net/token/issueToken"; var httpClient = new HttpClient(); var content = new FormUrlEncodedContent(new Dictionary<String, String> { { "grant_type", "client_credentials" }, { "client_id", speechClientId }, { "client_secret", speechClientSecret }, { "scope", "https://speech.platform.bing.com" } }); HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content); String result = aResponse.Content.ReadAsStringAsync().Result; var obj= JsonConvert.DeserializeObject<AdmAccessToken>(result); return "Bearer " + obj.access_token; } public class AdmAccessToken { public string access_token { get; set; } }
  • 36. (3)しゃべる翻訳アプリ 音声認識版 u Bing Speech APIをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro https://www.microsoft.com/cognitive-services/en-US/subscriptions speechClientId speechClientSecret
  • 37. (3)しゃべる翻訳アプリ 音声認識版 u MS Translator APIをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro public async Task<String> getTranslatedString(String str, String FromLang, String ToLang) { String token = await getTranslateAccessToken(); String encstr = Uri.EscapeDataString(str); String urlString = "http://api.microsofttranslator.com/v2/Http.svc/Translate?text=" + encstr + "&from=" + FromLang + "&to=" + ToLang; httpClient.DefaultRequestHeaders.Add("Authorization", token); HttpResponseMessage aResponse = await httpClient.GetAsync(urlString); result = aResponse.Content.ReadAsStringAsync().Result; return rtnstr; }
  • 38. (3)しゃべる翻訳アプリ 音声認識版 u MS Translator APIをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro public async Task<String> getTranslateAccessToken() { String urlString = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13"; var httpClient = new HttpClient(); var content = new FormUrlEncodedContent(new Dictionary<String, String> { { "grant_type", "client_credentials" }, { "client_id", translatorClientId }, { "client_secret", translatorClientSecret }, { "scope", "http://api.microsofttranslator.com" } }); HttpResponseMessage aResponse = await httpClient.PostAsync(urlString, content); String result = aResponse.Content.ReadAsStringAsync().Result; var obj = JsonConvert.DeserializeObject<AdmAccessToken>(result); return "Bearer " + obj.access_token; } public class AdmAccessToken { public string access_token { get; set; } }
  • 39. (3)しゃべる翻訳アプリ 音声認識版 u MS Translator APIをXamarin.Formsで使う 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro https://datamarket.azure.com/developer/applications translatorClientId translatorClientSecret
  • 40. 2016/10/15All rights reserved. Copyright(C) 2016 AYASE Hiro ご静聴ありがとうございました