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
790
Introducing Inkdrop for Mobile Built with React Native
craftzdog
1
2.2k
The fun Deep Learning
craftzdog
0
2.6k
Other Decks in Technology
See All in Technology
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
AGIについてChatGPTに聞いてみた
blueb
0
130
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
Terraform Stacks入門 #HashiTalks
msato
0
350
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
280
AIチャットボット開発への生成AI活用
ryomrt
0
170
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
複雑なState管理からの脱却
sansantech
PRO
1
140
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Building Your Own Lightsaber
phodgson
103
6.1k
Producing Creativity
orderedlist
PRO
341
39k
Navigating Team Friction
lara
183
14k
The Invisible Side of Design
smashingmag
298
50k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
The Cult of Friendly URLs
andyhume
78
6k
For a Future-Friendly Web
brad_frost
175
9.4k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
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