Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CreateMLとCoreMLでカンタンMachine Learning App開発

odasho
June 21, 2018

CreateMLとCoreMLでカンタンMachine Learning App開発

2018/6/21 iOSコンソーシアム Tech Working Group

odasho

June 21, 2018
Tweet

More Decks by odasho

Other Decks in Programming

Transcript

  1. Speaker’s Profile Shohei Oda MITSUI KNOWLEDGE INDUSTRY CO,. LTD. Mobile

    Application Development / IoT(Device, Cloud, etc...) / UIUX / Web / VR / Education / etc… odasho0618 @mki_oda odasho
  2. ͳʹ΍Β͍Ζ͍Ζൃද͞Εͯͨ WWDC 2018 iOS 12 SharedAR, Measure App, ARKit2 USDZ

    Format, Memoji, Facetime(Group Chat), Siri Shortcut, Scream Time, Smart Notifications, Shared Voice Memo, Car Play WatchOS 5 transceiver Function, Siri Shortcut Web Content, Podcast, Auto Workout, Rainbow Band tvOS 12 Support Dolby Atmos macOS Mojave(10.14) Dark Mode, CoreML2(CreateML) Desktop Stacks Movie Shooting Scream Shot Community Camera(Linkage Mac-iOS) Use UIKit for Mac Use a part of iOS App(Home, Stock) etc…
  3. iOS 12 SharedAR, Measure App, ARKit2 USDZ Format, Memoji, Facetime(Group

    Chat), Siri Shortcut, Scream Time, Smart Notifications, Shared Voice Memo, Car Play WatchOS 5 transceiver Function, Siri Shortcut Web Content, Podcast, Auto Workout, Rainbow Band tvOS 12 Support Dolby Atmos macOS Mojave(10.14) Dark Mode, CoreML2(CreateML) Desktop Stacks Movie Shooting Scream Shot Community Camera(Linkage Mac-iOS) Use UIKit for Mac Use a part of iOS App(Home, Stock) etc… ࠓճ஫໨ͨ͠ͷ͸ίϨʜ
  4. ࠓճ͡ΎΜͼͨ͠΋ͷ n Macbook • macOS 10.14 Beta 2 (Mojave) •

    Xcode 10 Beta 2 n ֶ͖͔͍शνʔϜ͔Β΋ΒͬͨλϫγͱϋϦωζϛͷࣸਅ ೖख͸AppleDeveloper ͷDownloads͔Β https://developer.apple.com/download/ (AppleDeveloperͷAccount͕ͻͭΑ͏)
  5. ༻ҙ͢ΔֶशDataʹ͍ͭͯ Χϯλϯʹߟ͑ͯΈΔɻ n Training Data • ֶ͖͔͍शͤ͞Δσʔλ Θ͔Δ n Evaluation

    Data • ֶ͖͔͍शͨ͠σʔλΛͻΐ͏͔͢Δσʔλ ·͊Θ͔Δ n Validation Data • ֶ͖͔͍शͨ͠σʔλΛνϡʔχϯά͢ΔͨΊͷσʔλ Θ͔Βͳ͍
  6. Appendix n Swift Playground • CodeͷΈͰmlmodelͷ࡞͍ͤ΋Ͱ͖Δ import Foundation import CreateML

    // Specify Data let trainDirectory = URL(fileURLWithPath: "/Users/shoheioda/Desktop/Machine_Learning/TAG-IMG/Train_Vali/") let testDirectory = URL(fileURLWithPath: "/Users/shoheioda/Desktop/Machine_Learning/TAG-IMG/EvaluationData/")
  7. Appendix n Swift Playground • CodeͷΈͰmlmodelͷ࡞͍ͤ΋Ͱ͖Δ // Create Model let

    model = try MLImageClassifier(trainingData: .labeledDirectories(at: trainDirectory)) // Evaluate Model let evaluation = model.evaluation(on: .labeledDirectories(at: testDirectory)) // Save Model try model.write(to: URL(fileURLWithPath: "/Users/shoheioda/Desktop/Hari_TawashiClassifier.mlmodel"))