Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 1.48 KB

README.md

File metadata and controls

24 lines (19 loc) · 1.48 KB

Deploy deep learning models on your iPhone/iPad

using the mxnet c predict api

Initially I tried to run a 50MB ssd object detection network on the iPhone and failed due to insufficient RAM. It currently runs a 5MB mobilenet (from the model zoo) for classification among 1000 classes. In order to detect objects (or even do segmentation), small networks like tinyyolo or tinyssd are essential for mobile devices.

Mxnet is used here because it is the main deep learning framework I learn and use, and it has a rich model zoo (gluoncv.model_zoo) to offer. It is also a lightweight framework to be used anywhere and, for example, I can train a model with it on some workstation/AWS and easily deploy this model onto the end-use device (e.g. a phone) without the need/pain to convert it.


(tested on iPhoneX)
how to run on your iPhone: (files in step 2,3 are not included for being too large)

  1. clone and open the Xcode project and
  2. put opencv2.framework (downloadable from official website) in folder 'ios_mx_det/opencv'
  3. compile the mxnet prediction api (static library libmxnet_ios_lib.a file) for iOS and put it in 'ios_mx_det/mxnet'
    (I used mxnet 1.2.0 since 1.3 doesn't work for some reason. Refer to apache/mxnet#11184 or https://www.jianshu.com/p/8f703c10540e)
  4. build and run on device