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
Caffeでお手軽本格ディープラーニングiOSアプリ
Search
Takuya Matsuyama
October 13, 2015
Technology
1
1.5k
Caffeでお手軽本格ディープラーニングiOSアプリ
@potatotips #22
#DeepLearning #MachineLearning
Takuya Matsuyama
October 13, 2015
Tweet
Share
More Decks by Takuya Matsuyama
See All by Takuya Matsuyama
ネイティブモジュールの作り方 @ React Native Meetup #9 in Japan
craftzdog
6
1.2k
How to Create Native Modules @ React Native Japan Meetup #9
craftzdog
1
810
Introducing Inkdrop for Mobile Built with React Native
craftzdog
1
2.2k
The fun Deep Learning
craftzdog
0
2.7k
Other Decks in Technology
See All in Technology
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
150
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!事例のご紹介+座学②
siyuanzh09
0
110
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
290
Goで実践するBFP
hiroyaterui
1
120
Azureの開発で辛いところ
re3turn
0
240
いま現場PMのあなたが、 経営と向き合うPMになるために 必要なこと、腹をくくること
hiro93n
9
7.8k
タイミーのデータ活用を支えるdbt Cloud導入とこれから
ttccddtoki
1
180
Reactフレームワークプロダクトを モバイルアプリにして、もっと便利に。 ユーザに価値を届けよう。/React Framework with Capacitor
rdlabo
0
130
メールヘッダーを見てみよう
hinono
0
110
新卒1年目、はじめてのアプリケーションサーバー【IBM WebSphere Liberty】
ktgrryt
0
130
My small contributions - Fujiwara Tech Conference 2025
ijin
0
1.5k
Kotlin Multiplatformのポテンシャル
recruitengineers
PRO
2
150
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Gamification - CAS2011
davidbonilla
80
5.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Visualization
eitanlees
146
15k
BBQ
matthewcrist
85
9.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
3
180
Music & Morning Musume
bryan
46
6.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
$B⒎FͰ͓खܰຊ֨ σΟʔϓϥʔχϯά J04ΞϓϦ 5",6:" !OPSBEBJLP QPUBUPUJQT
দࢁ w !OPSBEBJLP w ϑϦʔϥϯε ݩ:BIPP w J04ΞϓϦ ΣϒΞϓϦͳͲΛ੍࡞
w ػցֶशʹڵຯ͋Γ w ֆඳ͖·͢ 2
ΊΜ͖͖ ໙ར͖ 3
4 ໙ར͖ ࣸਅʹج͍ͮͯϥʔϝϯΛਪન͢ΔΞϓϦ ೖྗ
5 σΟʔϓϥʔχϯά ͷٕज़Λ༻ ʴ ʹ
ը૾ೝࣝʹڧ͍ ػցֶशΞϧΰϦζϜ 6 σΟʔϓϥʔχϯάͱ
w ͷਆܦߏΛ฿ͨ͠χϡʔϥϧωοτϫʔΫͷҰछ w େྔͷσʔλ͔ΒମͷಛΛࣗಈతʹֶश ‣ ͜Ε·Ͱಛͷநग़ํ๏ਓ͕͕ؒΜͬͯ༻ҙ͍ͯͨ͠ 7
࡞Ζ͏ σΟʔϓϥʔχϯάΞϓϦ ୭Ͱ؆୯ʹ࡞ΕΔํ๏Λ͝հ͠·͢ 8
$B⒎F σΟʔϓϥʔχϯά༻ ϑϨʔϜϫʔΫ w IUUQDB⒎FCFSLFMFZWJTJPOPSH w (16ԋࢉ $6%" ͰߴʹֶशͰ͖Δ w
͙͢ʹࢼͤΔֶशࡁΈϞσϧ͋Δ w .BD049ରԠ 9
Caffe for J04্Ͱಈ͘$B⒎F w IUUQTHJUIVCDPNBMFQIDB⒎F w $B⒎FͷGPSL w J04্Ͱࣝผॲཧ͕࣮༻ʹ͑ΔͰಈ͔ͤΔ ‣
J1IPOFTͰʙඵ w αʔό͍ΒͣͰ͑Δ w ͨͩ͠9$PEF·ͩඇରԠ 10
$B⒎FGPSJ04 αϯϓϧ࡞Γ·ͨ͠ w IUUQTHJUIVCDPNOPSBEBJLP DB⒎FJPTTBNQMF w ୯७ͳମೝࣝ w #-7$$B⒎F/FU.PEFMΛ༻ 11
demo
༻͢Δσʔλ w MBCFMTUYUࣝผ݁ՌΛ໊લʹม͢ΔͨΊͷҰཡ w EFQMPZQSPUPUYUωοτϫʔΫఆٛ w NFBOCJOBSZQSPUPฏۉը૾ w CWMD@SFGFSFODF@DB⒎FOFUDB⒎FNPEFMֶशࡁΈσʔλ 13
ॲཧͷྲྀΕ ࣝผରͷը૾ͷಡΈࠐΈ w ૾ͷը૾ $MBTTJpFSΫϥεͷॳظԽ w ͭͷϞσϧσʔλͷϑΝΠϧύεΛࢦఆ $MBTTJpFSͷ࣮ߦ w ը૾Λࢦఆͯ݁͠ՌΛऔಘ
ࣝผ݁Ռͷग़ྗ 14
UIImage* image = [UIImage imageNamed:@"sample.jpg"]; cv::Mat src_img, img; UIImageToMat(image, src_img);
cv::cvtColor(src_img, img, CV_RGBA2BGRA); ը૾ͷಡΈࠐΈ w 6**NBHFΛಡΈࠐΈ w DW.BUܗࣜʹม w ΧϥʔྻΛ3(#"͔Β#(3"ʹม
// ϑΝΠϧύεΛstringܕʹม string model_file_str = std::string([model_file UTF8String]); string label_file_str =
std::string([label_file UTF8String]); string trained_file_str = std::string([trained_file UTF8String]); string mean_file_str = std::string([mean_file UTF8String]); Classifier classifier = Classifier(model_file_str, trained_file_str, mean_file_str, label_file_str); $MBTTJpFSͷॳظԽ w ϞσϧఆٛɺϥϕϧɺֶशࡁΈϞσϧɺฏۉը૾ͷύεΛऔಘ w ֤ϑΝΠϧύεΛTUETUSJOHʹม w $MBTTJpFSͷΠϯελϯεΛ࡞
// ࣝผͷ࣮ߦ std::vector<Prediction> result = classifier.Classify(img); $MBTTJpFSͷ࣮ߦ w ը૾Λࢦఆ͢Δ͚ͩʂ
for (std::vector<Prediction>::iterator it = result.begin(); it != result.end(); ++it) {
NSString* label = [NSString stringWithUTF8String:it->first.c_str()]; NSNumber* probability = [NSNumber numberWithFloat:it->second]; NSLog(@"label: %@, prob: %@", label, probability); } ࣝผ݁Ռͷग़ྗ w TUEWFDUPSܗࣜͰෳͷࣝผީิ͕ಘΒΕΔ w JUFSBUPSͰճ֤ͯ͠ީิΛऔಘ w JUpSTUϥϕϧɺJUTFDPOE֬
·ͱΊ w $B⒎FΛ͑ΦϦδφϧͷֶशϞσϧ͕࡞ΕΔ w $B⒎FGPSJ04ͳΒαʔό͍ΒͣͰࣝผॲཧ͕ग़དྷΔ w αϯϓϧϓϩδΣΫτͷ͝հ w ΦϦδφϧͷֶशϞσϧͰΞϓϦΛ࡞Ζ͏ʂ 19
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ 20