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

shicai/MobileNet-Caffe: Caffe Implementation of Google's MobileNets (v1 and ...

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

开源软件名称(OpenSource Name):

shicai/MobileNet-Caffe

开源软件地址(OpenSource Url):

https://github.com/shicai/MobileNet-Caffe

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

MobileNet-Caffe

Introduction

This is a Caffe implementation of Google's MobileNets (v1 and v2). For details, please read the following papers:

Pretrained Models on ImageNet

We provide pretrained MobileNet models on ImageNet, which achieve slightly better accuracy rates than the original ones reported in the paper.

The top-1/5 accuracy rates by using single center crop (crop size: 224x224, image size: 256xN):

Network Top-1 Top-5 sha256sum Architecture
MobileNet v1 70.81 89.85 8d6edcd3 (16.2 MB) netscope, netron
MobileNet v2 71.90 90.49 a3124ce7 (13.5 MB) netscope, netron

Evaluate Models with a single image

Evaluate MobileNet v1:

python eval_image.py --proto mobilenet_deploy.prototxt --model mobilenet.caffemodel --image ./cat.jpg

Expected Outputs:

0.42 - 'n02123159 tiger cat'
0.08 - 'n02119022 red fox, Vulpes vulpes'
0.07 - 'n02119789 kit fox, Vulpes macrotis'
0.06 - 'n02113023 Pembroke, Pembroke Welsh corgi'
0.06 - 'n02123045 tabby, tabby cat'

Evaluate MobileNet v2:

python eval_image.py --proto mobilenet_v2_deploy.prototxt --model mobilenet_v2.caffemodel --image ./cat.jpg

Expected Outputs:

0.26 - 'n02123159 tiger cat'
0.22 - 'n02124075 Egyptian cat'
0.15 - 'n02123045 tabby, tabby cat'
0.04 - 'n02119022 red fox, Vulpes vulpes'
0.02 - 'n02326432 hare'

Finetuning on your own data

Modify deploy.prototxt and save it as your train.prototxt as follows: Remove the first 5 input/input_dim lines, and add Image Data layer in the beginning like this:

layer {
  name: "data"
  type: "ImageData"
  top: "data"
  top: "label"
  include {
    phase: TRAIN
  }
  transform_param {
    scale: 0.017
    mirror: true
    crop_size: 224
    mean_value: [103.94, 116.78, 123.68]
  }
  image_data_param {
    source: "your_list_train_txt"
    batch_size: 32 # your batch size
    new_height: 256
    new_width: 256
    root_folder: "your_path_to_training_data_folder"
  }
}

Remove the last prob layer, and add Loss and Accuracy layers in the end like this:

layer {
  name: "loss"
  type: "SoftmaxWithLoss"
  bottom: "fc7"
  bottom: "label"
  top: "loss"
}
layer {
  name: "top1/acc"
  type: "Accuracy"
  bottom: "fc7"
  bottom: "label"
  top: "top1/acc"
  include {
    phase: TEST
  }
}
layer {
  name: "top5/acc"
  type: "Accuracy"
  bottom: "fc7"
  bottom: "label"
  top: "top5/acc"
  include {
    phase: TEST
  }
  accuracy_param {
    top_k: 5
  }
}

Related Projects

MobileNet in this repo has been used in the following projects, we recommend you to take a look:

Updates (Feb. 5, 2018)

  • Add pretrained MobileNet v2 models (including deploy.prototxt and weights)
  • Hold pretrained weights in this repo
  • Add sha256sum code for pretrained weights
  • Add some code snippets for single image evaluation
  • Uncomment engine: CAFFE used in mobilenet_deploy.prototxt
  • Add params (lr_mult and decay_mult) for Scale layers of mobilenet_deploy.prototxt
  • Add prob layer for mobilenet_deploy.prototxt



鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
xamarin/mobile-samples发布时间:2022-08-29
下一篇:
Zehaos/MobileNet: MobileNet build with Tensorflow发布时间: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