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のガバナンスの全体像と現実解
fnifni
1
190
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
290
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.8k
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.3k
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
120
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
230
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
200
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
320
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
230
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
270
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
190
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
KATA
mclloyd
29
14k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Done Done
chrislema
181
16k
Being A Developer After 40
akosma
87
590k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Optimizing for Happiness
mojombo
376
70k
Git: the NoSQL Database
bkeepers
PRO
427
64k
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