• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

hollance/MobileNet-CoreML: The MobileNet neural network using Apple's new Co ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

hollance/MobileNet-CoreML

开源软件地址(OpenSource Url):

https://github.com/hollance/MobileNet-CoreML

开源编程语言(OpenSource Language):

Swift 90.9%

开源软件介绍(OpenSource Introduction):

MobileNet with CoreML

This is the MobileNet neural network architecture from the paper MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications implemented using Apple's shiny new CoreML framework.

This uses the pretrained weights from shicai/MobileNet-Caffe.

There are two demo apps included:

  • Cat Demo. Shows the prediction for a cat picture. Open the project in Xcode 9 and run it on a device with iOS 11 or on the simulator.

  • Camera Demo. Runs from a live video feed and performs a prediction as often as it can manage. (You'll need to run this app on a device, it won't work in the simulator.)

The cat demo app

Note: Also check out Forge, my neural net library for iOS 10 that comes with a version of MobileNet implemented in Metal.

Converting the weights

The repo already includes a fully-baked MobileNet.mlmodel, so you don't have to follow the steps in this section. However, in case you're curious, here's how I converted the original Caffe model into this .mlmodel file:

  1. Download the caffemodel file from shicai/MobileNet-Caffe into the top-level folder for this project.

Note: You don't have to download mobilenet_deploy.prototxt. There's already one included in this repo. (I added a Softmax layer at the end, which is missing from the original.)

  1. From a Terminal, do the following:
$ virtualenv -p /usr/bin/python2.7 env
$ source env/bin/activate
$ pip install tensorflow
$ pip install keras==1.2.2
$ pip install coremltools

It's important that you set up the virtual environment using /usr/bin/python2.7. If you use another version of Python, the conversion script will crash with Fatal Python error: PyThreadState_Get: no current thread. You also need to use Keras 1.2.2 and not the newer 2.0.

  1. Run the coreml.py script to do the conversion:
$ python coreml.py

This creates the MobileNet.mlmodel file.

  1. Clean up by deactivating the virtualenv:
$ deactivate

Done!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
DJI Developer发布时间:2022-08-29
下一篇:
dji-sdk/Mobile-SDK-Android: DJI Mobile SDK for Android: http://developer.dji.com ...发布时间:2022-08-29
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap