Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ML Kit を Android で 動かしてみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
radiocat
June 14, 2018
Technology
960
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ML Kit を Android で 動かしてみた
radiocat
June 14, 2018
More Decks by radiocat
See All by radiocat
EMの仕事、あるいは顧客価値創出のアーキテクト
radiocat
0
360
アジャイルを支える心理的安全性の守破離 / Psychological safety for Agile
radiocat
1
900
経験ゼロからはじめる!10年以上続くプロダクトのアウトカム創出戦略 / Challenges of product management
radiocat
1
4.9k
変化の時代に活かす「みんなのプロジェクトマネジメント」 / Utilize project management for change
radiocat
0
2k
「中小企業のエンジニアチームを”楽”にする」を目指す組織マネジメントの変わる勇気と変えない勇気 / Challenge to Scrum 4
radiocat
2
4.1k
関西的なノリで変化の波をノリこなすチームの取り組み / 3 Steps and Kansai-soul to Riding the Waves of Change
radiocat
2
3.7k
スクラムちゃうがなと言われてもやってみぃひん? / Challenge to Scrum 3
radiocat
4
11k
Re:ゼロから始めるアジャイル開発 / restart agile
radiocat
3
1.7k
スクラム開発について / What is Scrum?
radiocat
0
610
Other Decks in Technology
See All in Technology
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
1
220
Data + AI Summit 2026 イベントレポート: 「AIがビジネスで意思決定するデータ基盤」へ
nek0128
0
260
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
310
「最後に責任を取るのはチーム」— 人間のPRレビューを最小化してアップデートしたメンタルモデル
jnishime_dresscode
0
880
CDKで書くECSのベストプラクティス、 改めて考え直す2026 #cdkconf2026
makies
3
780
公式ドキュメントの歩き方etc
coco_se
1
120
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
0
180
AI時代の闇と光
tatsuya1970
0
110
AI時代の開発生産性は、個人技からチーム設計へ
moongift
PRO
4
2.4k
End-to-Endで考える信頼性 —LINEアプリにおけるクライアント開発×SRE連携の実践
maruloop
4
4.5k
Devsumi 2026 Summer 人もAIも使える共通基盤を事業の加速装置にする~デザインシステム運用に学ぶ組織レバレッジ~ 渡辺 凌央
legalontechnologies
PRO
1
230
【Claude Code】鹿野さんに聞く 私の推しの並行開発環境 大公開 / claude-code-parallel-2026-07-15
tonkotsuboy_com
12
8.6k
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
340
The Curse of the Amulet
leimatthew05
2
13k
It's Worth the Effort
3n
188
29k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Building AI with AI
inesmontani
PRO
1
1.1k
Chasing Engaging Ingredients in Design
codingconduct
0
240
Code Review Best Practice
trishagee
74
20k
The agentic SEO stack - context over prompts
schlessera
0
850
Transcript
ML Kit を Android で 動かしてみた 2018.6.14 / @radiocatz Osaka
Mix Leap Study #16 - Android JetPack 勉強会 - LT
おしごと 現職:株式会社 ラクス 所属:楽楽精算 開発チーム リーダー/スクラムマスター About me radiocat Twitter
: @radiocatz Android派/Vim派/野球派/KIRINビー ル派 HTC DesireからAndroidユーザー Blog : http://radiocat.hatenablog.com/ Qiita : https://qiita.com/radiocat GitHub : https://github.com/radiocat Androidアプリ 社内の勉強会の運営もやってます 共同開催・ゲスト登壇募集中!
ML Kitについて
ML Kit for Firebase • Android/iOS向け機械学習SDK • Google I/O 2018で発表
• 現在パブリックベータ • Googleに訓練されたMLモデルを利用可能 • TensorFlow Liteの自作モデル(Custom Models)も利用可能 • 2種類のAPI ◦ On-device:デバイスに組み込んで通信なしで使える軽量なモデル ◦ In the Cloud:クラウド上の高度なモデル
MLモデルAPIについて
None
On-device/Cloud
On-deviceで使えるAPI 無料で使える • 顔検出 • バーコードスキャン • 自作モデル • テキスト認識(※In
the Cloudでも使える) ◦ Latin-based languageのみ • 画像のラベル付け(※In the Cloudでも使える) ◦ 400+ labels
In the Cloudで使えるAPI Cloud Vision APIを使う Firebase の課金プランを Blaze(従量制課金)にする必要がある •
ランドマーク認識 • テキスト認識(※On-deviceでも使える) ◦ 多言語対応(日本語を使いたいならこちら) • 画像のラベル付け(※On-deviceでも使える) ◦ 1000+ labels ※On-device/In the Cloudの両方で使う場合はそれぞれ実装する
使い方
build.gradleへ追加 ML Kitの依存ライブラリ Google Services implementation 'com.google.firebase:firebase-ml-vision:16.0.0' implementation 'com.google.firebase:firebase-ml-vision-image-label-model:15.0.0' implementation
'com.google.firebase:firebase-ml-model-interpreter:16.0.0' apply plugin: 'com.google.gms.google-services'
画像のラベル付けの場合① FirebaseVisionImageオブジェクトを作る FirebaseVisionLabelDetectorのインスタンスを取得する FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap); FirebaseVisionLabelDetector detector =
FirebaseVision.getInstance() .getVisionLabelDetector();
画像のラベル付けの場合② Task<List<FirebaseVisionLabel>> result = detector.detectInImage(image) .addOnSuccessListener( new OnSuccessListener<List<FirebaseVisionLabel>>() { @Override
public void onSuccess(List<FirebaseVisionLabel> labels) { // 取得成功した場合の処理 } }) .addOnFailureListener( // 以下略
画像のラベル付けの場合③ ラベル付きオブジェクトの情報を取得 for (FirebaseVisionLabel label: labels) { String text =
label.getLabel(); String entityId = label.getEntityId(); float confidence = label.getConfidence(); }
それぞれのAPI向けのDetectorが用意されている 扱い方はだいたい同じ 参考:ML Kit for Firebase | Firebase https://firebase.google.com/docs/ml-kit/ On-device
Cloud FirebaseVisionTextDetector FirebaseVisionCloudDocumentTextDetector FirebaseVisionFaceDetector ー FirebaseVisionBarcodeDetector ー FirebaseVisionLabelDetector FirebaseVisionCloudLabelDetector ー FirebaseVisionCloudLandmarkDetector
試してみる
手っ取り早く公式のサンプルアプリをビルド 1. Firebaseプロジェクトを作成しgoogle-services.jsonをダウンロード 2. https://github.com/firebase/quickstart-android を git clone 3. quickstart-android/mlkitをAndroid
Studioでインポート 4. google-services.jsonをmlkit/appの下に配置してビルド
Demo
所感 • 仕組み的にはVision APIとTensorFlow Liteモデルなどの既存機能をSDKにパッケー ジングして使いやすくした感じ • と言うとたいしたことなく聞こえるけどリアルタイムでMLの予測が動くのはすごい • これがSDKを使うだけで誰でも作れそうなことに恐怖すら感じた
• しかもOn-deviceだけ使うなら無料!
Thank you
References • Google Developers Blog: Introducing ML Kit ◦ https://developers.googleblog.com/2018/05/introducing-ml-kit.html
• Y.A.M の 雑記帳: I/O Recap : ML Kit 情報まとめ(Android 向け) ◦ https://y-anz-m.blogspot.jp/2018/05/io-recap-ml-kit-android.html • Google OS実験室 ~Moonlight 明日香~ : Google ML Kit試してみた! ◦ http://google-os.blog.jp/archives/50874071.html