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
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
370
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
180
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
170
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
750
Wantedly での Datadog 活用事例
bgpat
1
470
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
110
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
460
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
270
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
140
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
130
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Thoughts on Productivity
jonyablonski
67
4.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Music & Morning Musume
bryan
46
6.2k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
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