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
FlutterでMLKitを使ってみる.pdf
Search
sayurikunugi
August 28, 2018
2
1.3k
FlutterでMLKitを使ってみる.pdf
flutterでFirebase MLKitを使ってみる
sayurikunugi
August 28, 2018
Tweet
Share
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
How GitHub (no longer) Works
holman
314
140k
RailsConf 2023
tenderlove
30
1.1k
4 Signs Your Business is Dying
shpigford
183
22k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
GraphQLとの向き合い方2022年版
quramy
46
14k
Code Reviewing Like a Champion
maltzj
523
40k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.2k
Transcript
Flutterで ML Kitを使ってみる
自己紹介 • エンジニア • 会社:HealtheeOne https://healtheeone.com • Android 7年くらい • Ios/Xcodeは未経験
• Flutterは2週間くらい…(初心者ですすみません) 簡単なOCRのモックプロジェクト作って、apk作るまでを1 週間くらいでやったので、その雑感をまとめます。
Flutterを始めたきっかけ • UI/画面遷移が単純な新規アプリを、Android/IOSで作る必 要が出てきた →Flutterで作れるかも? • 前からIOS興味あったし、 • Google I/Oでも取り上げられていたし、
どうせならモックからFlutterで作ってみよう!
ML Kitとは • 画像認識システム。機械学習機能も。 https://firebase.google.com/products/ml-kit/?hl=j a 「Image Labeling」-画像に写っているものをリス トアップできる 「Text
recognition 」 -文字を認識できる 「Face detection 」 -顔を認識する 「Barcode scanning 」 -バーコードを認識する 「Landmark detection 」 -有名な場所を認識する
Flutterで ML Kit • プラグイン https://pub.dartlang.org/packages/firebase_ml_ vision ※使った方 ⭐️ https://pub.dartlang.org/packages/mlkit
※official
Firebaseの設定 • https://codelabs.developers.google.com/codela bs/flutter-firebase/#4 • 注意 6. Platform-specific Firebase configuration
の手 中、 順 iOSは6まででOK ※6.Continuing in Firebase, follow the instructions to download the config file GoogleService-Info.plist.
サンプルプロジェクト紹介① https://github.com/sayurikunugi/flutter_mlkit_sample
サンプルプロジェクト紹介②
サンプルプロジェクト紹介③
大変だったところ① • Androidではデバッグアプリ動くんだけど、 iOSでビルドが通らない… • officialプラグインも非officialもダメ。 →githubで、両方ともissueしてみた • officialの方は「flutter doctorの結果を載せて」と返事
※issue時はflutter doctorの結果はマストらしい • 非officialの方は直してくれた 「 ios mlkit library has updated. I'll fix it soon! 」 • officialも更新してるので動きそう … プラグインのアップデート管理大変そう
大変だったところ② • APKのビルド https://flutter.io/android-release/ flutter build apk • apkを動かすとアプリがクラッシュ couldn't
find "libflutter.so" • flutter build apk --release --target-platform android-arm64 →使用端末では動いた • が、別の端末でcouldn't find "libflutter.so" →つづく
大変だったところ③ • CPUが32bitの端末らしい https://github.com/flutter/flutter/issues/18494 • 3.1.3以上のAndroidStudio使う or 32bit向けにapkをbuild build.gradle defaultConfig
{ ndk{ abiFilters "armeabi-v7a" }… } flutter build apk --release --target-platform android-arm
Flutter、 Dartの感想 • newはあっても無くてもどっちでもいいらしい • constがわかりにくい コンパイル時に作られるので、変数をパラメータにもったりす るとクラッシュしたり? • StatefulWidget:setState()するとbuild(onResume
みたいな)が走って画面が再描画される • file名!=クラス名。1ファイルに何クラスあってもok • レイアウトファイルがない
最後に • 始めたばかりだけど、おもしろい • UIパーツもプラグインも充実している • Issueは積極的に • 難読化、iOS向けリリースは今後のTODO •
これからもFlutterやってこうと思っているので、 よろしくお願いします!