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
780
Introducing Inkdrop for Mobile Built with React Native
craftzdog
1
2.2k
The fun Deep Learning
craftzdog
0
2.5k
Other Decks in Technology
See All in Technology
Oracle GoldenGate 23ai 導入Tips
oracle4engineer
PRO
1
230
PREEMPT_RT over the years
ennael
PRO
0
330
スタサプ ForSCHOOLアプリのシンプルな設計
recruitengineers
PRO
2
140
スモールスタート、不都合な真実 〜 耳当たりの良い言葉に現場が振り回されないために/20240930-ssmjp-small-start
opelab
13
1.8k
つよつよリーダーが 抜けたらどうする? 〜ナビタイムのAgile⽀援組織の変遷〜
navitimejapan
PRO
22
13k
Oracle Database 23ai 新機能#4 Application Continuity
oracle4engineer
PRO
0
110
Develop to Survive - YAPC::Hakodate 2024 Keynote
moznion
4
1.4k
【shownet.conf_】持続可能な次世代Wi-Fi運用に向けて
shownet
PRO
0
310
XP matsuri 2024 - 銀河英雄伝説に学ぶ
kawaguti
PRO
3
540
Efficient zero-copy networking using io_uring
ennael
PRO
0
320
たった一人で始めた音楽制作が気がついたら会社公認の部活動になっていた話〜組織の垣根を超えるコラボレーションを実現するには〜 / On-KAG-bu
piyonakajima
0
190
LeSSはスクラムではない!?LeSSにおけるスクラムマスターの振る舞い方とは / Scrum Master Behavior in LeSS
toma_sm
0
170
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
1
250
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.1k
What's in a price? How to price your products and services
michaelherold
243
11k
4 Signs Your Business is Dying
shpigford
180
21k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
125
18k
Gamification - CAS2011
davidbonilla
80
5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Facilitating Awesome Meetings
lara
49
6k
How GitHub Uses GitHub to Build GitHub
holman
473
290k
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.3k
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