• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    Python
  • Created over 7 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Caffe models (imagenet pretrain) and prototxt generator scripts for inception_v3 \ inception_v4 \ inception_resnet \ fractalnet \ resnext

Caffe-model

Python script to generate prototxt on Caffe, specially the inception_v3\inception_v4\inception_resnet\fractalnet

Generator scripts

The prototxts can be visualized by ethereon.

Every model has a bn (batch normalization) version (maybe only bn version), the paper is Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift

Classificaiton (imagenet)

Introduction

This folder contains the deploy files(include generator scripts) and pre-train models of resnet-v1, resnet-v2, inception-v3, inception-resnet-v2 and densenet(coming soon).

We didn't train any model from scratch, some of them are converted from other deep learning framworks (inception-v3 from mxnet, inception-resnet-v2 from tensorflow), some of them are converted from other modified caffe (resnet-v2). But to achieve the original performance, finetuning is performed on imagenet for several epochs.

The main contribution belongs to the authors and model trainers.

Performance on imagenet

  1. Top-1/5 accuracy of pre-train models in this repository.
Network 224/299(single-crop) 224/299(12-crop) 320/395(single-crop) 320/395(12-crop)
resnet101-v2 78.05/93.88 80.01/94.96 79.63/94.84 80.71/95.43
resnet152-v2 79.15/94.58 80.76/95.32 80.34/95.26 81.16/95.68
resnet269-v2 80.29/95.00 81.75/95.80 81.30/95.67 82.13/96.15
inception-v3 78.33/94.25 80.40/95.27 79.90/95.18 80.75/95.76
inception-v4 79.97/94.91 81.40/95.70 81.32/95.68 81.88/96.08
inception-resnet-v2 80.14/95.17 81.54/95.92 81.25/95.98 81.85/96.29
resnext50_32x4d 77.63/93.69 79.47/94.65 78.90/94.47 79.63/94.97
resnext101_32x4d 78.70/94.21 80.53/95.11 80.09/95.03 80.81/95.41
resnext101_64x4d 79.40/94.59 81.12/95.41 80.74/95.37 81.52/95.69
wrn50_2(resnet50_1x128d) 77.87/93.87 79.91/94.94 79.32/94.72 80.17/95.13
  • The pre-train models are tested on original caffe by evaluation_cls.py, but ceil_mode:false(pooling_layer) is used for the models converted from torch, the detail in https://github.com/BVLC/caffe/pull/3057/files. If you remove ceil_mode:false, the performance will decline about 1% top1.
  • 224x224(base_size=256) and 320x320(base_size=320) crop size for resnet-v2/resnext/wrn, 299x299(base_size=320) and 395x395(base_size=395) crop size for inception.
  1. Top-1/5 accuracy with different crop sizes. teaser
  • Figure: Accuracy curves of inception_v3(left) and resnet101_v2(right) with different crop sizes.
  1. Download url and forward/backward time cost for each model.

Forward/Backward time cost is evaluated with one image/mini-batch using cuDNN 5.1 on a Pascal Titan X GPU.

We use

  ~/caffe/build/tools/caffe -model deploy.prototxt time -gpu -iterations 1000

to test the forward/backward time cost, the result is really different with time cost of evaluation_cls.py

Network F/B(224/299) F/B(320/395) Download Source
resnet101-v2 22.31/22.75ms 26.02/29.50ms 170.3MB craftGBD
resnet152-v2 32.11/32.54ms 37.46/41.84ms 230.2MB craftGBD
resnet269-v2 58.20/59.15ms 69.43/77.26ms 390.4MB craftGBD
inception-v3 21.79/19.82ms 22.14/24.88ms 91.1MB mxnet
inception-v4 32.96/32.19ms 36.04/41.91ms 163.1MB tensorflow_slim
inception-resnet-v2 49.06/54.83ms 54.06/66.38ms 213.4MB tensorflow_slim
resnext50_32x4d 17.29/20.08ms 19.02/23.81ms 95.8MB facebookresearch
resnext101_32x4d 30.73/35.75ms 34.33/41.02ms 169.1MB facebookresearch
resnext101_64x4d 42.07/64.58ms 51.99/77.71ms 319.2MB facebookresearch
wrn50_2(resnet50_1x128d) 16.48/25.28ms 20.99/35.04ms 263.1MB szagoruyko

Check the performance

  1. Download the ILSVRC 2012 classification val set 6.3GB, and put the extracted images into the directory:

    ~/Database/ILSVRC2012
    
  2. Check the resnet-v2 (101, 152 and 269) performance, the settings of evaluation_cls.py:

    val_file = 'ILSVRC2012_val.txt' # download from this folder, label range 0~999
    ... ...
    model_weights = 'resnet-v2/resnet101_v2.caffemodel' # download as below
    model_deploy = 'resnet-v2/deploy_resnet101_v2.prototxt' # check the parameters of input_shape
    ... ...
    mean_value = np.array([102.9801, 115.9465, 122.7717])  # BGR
    std = np.array([1.0, 1.0, 1.0])  # BGR
    crop_num = 1    # perform center(single)-crop
    

    Check the inception-v3 performance, the settings of evaluation_cls.py:

    val_file = 'ILSVRC2015_val.txt' # download from this folder, label range 0~999
    ... ...
    model_weights = 'inception_v3/inception_v3.caffemodel' # download as below
    model_deploy = 'inception_v3/deploy_inception_v3.prototxt' # check the parameters of input_shape
    ... ...
    mean_value = np.array([128.0, 128.0, 128.0])  # BGR
    std = np.array([128.0, 128.0, 128.0])  # BGR
    crop_num = 1    # perform center(single)-crop
    

    Check the inception-resnet-v2 (inception-v4) performance, the settings of evaluation_cls.py:

    val_file = 'ILSVRC2012_val.txt' # download from this folder, label range 0~999
    ... ...
    model_weights = 'inception_resnet_v2/inception_resnet_v2.caffemodel' # download as below
    model_deploy = 'inception_resnet_v2/deploy_inception_resnet_v2.prototxt' # check the parameters of input_shape
    ... ...
    mean_value = np.array([128.0, 128.0, 128.0])  # BGR
    std = np.array([128.0, 128.0, 128.0])  # BGR
    crop_num = 1    # perform center(single)-crop
    

    Check the resnext (50_32x4d, 101_32x4d and 101_64x4d) or wrn50_2 performance, the settings of evaluation_cls.py:

    val_file = 'ILSVRC2012_val.txt' # download from this folder, label range 0~999
    ... ...
    model_weights = 'inception_resnet_v2/inception_resnet_v2.caffemodel' # download as below
    model_deploy = 'inception_resnet_v2/deploy_inception_resnet_v2.prototxt' # check the parameters of input_shape
    ... ...
    mean_value = np.array([103.52, 116.28, 123.675])  # BGR
    std = np.array([57.375, 57.12, 58.395])  # BGR
    crop_num = 1    # perform center(single)-crop
    
  3. then

    python evaluation_cls.py
    

Acknowlegement

I greatly thank Yangqing Jia and BVLC group for developing Caffe

And I would like to thank all the authors of every cnn model

More Repositories

1

AR-Source

Augmented reality (AR) development resources(增强现实开发资源汇总)---AIRX整理
1,738
star
2

Lee-VR-Source

VR developers necessary resources(VR 开发者必备资源汇总)
1,310
star
3

Source-WeChat

微信小程序开发资源汇总
235
star
4

AR-BXT-AR4Python

Augmented reality (AR) Python development library.
Python
68
star
5

Albert

程序员实用资源
21
star
6

keras

Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano and TensorFlow.
Python
16
star
7

opencv_iphoneAR

opencv 基于iphone 实现AR 效果
C++
12
star
8

ALVAR-3D-Tracking-

支持多个Marker,或者markerless的特征识别与跟踪,支持多种相机标定方案,使用起来也比较简单。它还支持多个PC平台以及移动平台的编译和运行。
C++
10
star
9

FaceDetection

Human Face Detection based on AdaBoost
Python
9
star
10

sidebar

拿来即用系列--9种html5+css3隐藏侧边栏导航菜单动画效果
CSS
8
star
11

android-CatLoadingView

android 系列第一弹--漂亮的加载效果
Java
7
star
12

SmallAppForQQ

微信小程序高仿QQUI
JavaScript
5
star
13

ARtoolkitPlus

artoolkitplus addons for openframeworks
C++
4
star
14

css-stars

css 特效拿来即用系列--这是一款使用纯CSS3制作的炫酷3D星空动画特效。该特效中,以飞船向前快速移动为视角,所有的星星都快速的变大并向后移动,效果非常逼真
HTML
4
star
15

SLAMwithCameraIMUforAndroid

SLAM with Camera and IMU (Android App)
Java
3
star
16

facenet

Face recognition using Tensorflow
Python
3
star
17

Hololens-Pokemon-Go

Pokemon Go Demo in HoloLens
C#
3
star
18

MarkerAR_Image_1.0

MarkerAR shows the image
C++
2
star
19

Opencv-AR

跟踪特征点并画AR物体
C++
2
star
20

face_morpher-master

Morph faces with Python OpenCV, Numpy, Scipy
Python
2
star
21

loam_velodyne

Laser Odometry and Mapping (Loam) is a realtime method for state estimation and mapping using a 3D lidar.
C++
2
star
22

MarkerAR_Mac_2.0

MarkerAR run on Mac OS X (V2.0)
C++
2
star
23

StructureFromMotion

opencv__StructureFromMotion
C++
2
star
24

Theano-Deep-learning

Theano Deep learning
Python
2
star
25

opencv_for_ios_book_samples

"OpenCV for iOS" book samples
Objective-C
2
star
26

SceneLib2

SceneLib2 is an open-source C++ library for SLAM originally designed and implemented
C++
2
star
27

TensorFlow-Examples

TensorFlow Tutorial and Examples for beginners
Jupyter Notebook
2
star
28

caffe-tensorflow

Caffe models in TensorFlow
Python
2
star
29

neural-doodle

使用深度神经网络把你的二流涂鸦变成艺术一般的作品!
Python
2
star
30

MultiCol-SLAM

This repository contains a multi-fisheye camera SLAM. The underlying SLAM system is based on ORB-SLAM.
C++
2
star
31

image-match

Image-match是一个用于从语料库中寻找近似图像进行匹配的简单包。与之类似,例如,pHash,它包含一个数据库后端,并且很容易扩展到数十亿图像和支持持续的高比率的图像插入
Python
2
star
32

dlib

Dlib 是一个现代C++工具包,包含机器学习算法和工具,用于使用C++创建复杂的软件来解决现实问题。它在工业界和学术界的各领域都有广泛应用,包括机器人、嵌入式设备、移动电话和大型高性能计算环境。
C++
2
star
33

Loading

拿来即用系列--loading
CSS
1
star
34

slambook

SLAM Book
C++
1
star
35

have-fun-with-machine-learning

An absolute beginner's guide to Machine Learning and Image Classification with Neural Networks
Python
1
star
36

opencv-candy

opencv 边缘检测
C++
1
star
37

aristotle-metadata-registry

1
star
38

-javascript-demo

用javascript实现图片缩小(适合javascript初学者,了解setInterval)
HTML
1
star
39

Tango-demo

Google Tango AR
C#
1
star
40

tensorlayer

TensorLayer: Deep Learning and Reinforcement Learning Library for Researcher and Engineer.
Python
1
star
41

WeChat-App-demo

微信小程序
JavaScript
1
star
42

button-demo

模板第七弹--按钮特效
CSS
1
star
43

javascript-plug-in

实现波浪文字动画特效的纯JS插件
CSS
1
star
44

tensorflow_speech_recognition_demo

This is the code for 'How to Make a Simple Tensorflow Speech Recognizer' by @Sirajology on Youtube(Fork llSourcell)
Python
1
star
45

MarkerAR_iOS

MarkerAR run on iOS11.0
C++
1
star
46

material

material ui模板第一弹,拿来即用
CSS
1
star
47

Opencv-for-Android-Demo

Opencv for Android 的图像处理项目
Java
1
star
48

TwoBattle

unity基础案例--双人battle
HTML
1
star
49

css3-style-demo

纯CSS3百叶窗式切换轮播图特效
CSS
1
star
50

okvis

OKVIS: Open Keyframe-based Visual-Inertial SLAM.
C++
1
star
51

unrealcv

UnrealCV: Connecting Computer Vision to Unreal Engine
C++
1
star
52

vowpal_wabbit

Vowpal Wabbit是一个机器学习系统,该系统推动了如在线、散列、Allreduce、Learning2search、等方面机器学习前沿技术的发展
PostScript
1
star
53

openAI-gym

A toolkit for developing and comparing reinforcement learning algorithms
Python
1
star
54

aerosolve

A machine learning package built for humans
Java
1
star
55

tf-faster-rcnn

Tensorflow Faster RCNN
Python
1
star
56

RPLidar-SLAMbot

Evolving codebase for a SLAM-capable robot using the RoboPeak LIDAR sensor
Python
1
star
57

css-and-Android-button

纯CSS3 Android样式按钮点击波特效
CSS
1
star
58

CommonSense

Code for building ConceptNet from raw data.
Python
1
star
59

tensorflow_resource

图解tensorflow 源码(fork)
1
star
60

MarkerlessAR

MarkerlessAR
C++
1
star
61

awesome-slam-fork-

A curated list of awesome SLAM tutorials, projects and communities.
1
star
62

Leeweb

web 资源网
1
star
63

MarkerAR_Mac_1.0

MarkerAR run on Mac OS X (V1.0)
C++
1
star
64

QuickSideBar-Android

android 侧边栏(类似微信)
Java
1
star
65

Fflippage

超神奇的css3和jquery翻书效果
HTML
1
star
66

SLAM__Opencv

C++
1
star
67

Lee-web

自己开发的web 资源网站,源码奉上
1
star
68

-button

模板三-线框button
HTML
1
star
69

TensorKar

self-driving MarioKart with TensorFlow
Python
1
star
70

9-CSS3-UI-

9种纯CSS3人物信息卡片UI设计效果
CSS
1
star
71

pix2pix

Image-to-image translation with conditional adversarial nets https://phillipi.github.io/pix2pix/
Lua
1
star
72

deepdetect

Deep Learning API and Server in C++11 with Python bindings and support for Caffe, Tensorflow and XGBoost
C++
1
star
73

HeadPoseEstimation

Opencv__HeadPoseEstimation
C++
1
star
74

cartographer-from-Google-

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
C++
1
star
75

ORB_SLAM2

ORB_SLAM2-master
C++
1
star
76

hyperopt-sklearn

Hyperopt-sklearn 是基于 Hyperopt 的模型,用于 scikit-learn 项目中的机器学习算法,找到适用你的数据的正确分类器可能很难。选好分类器后,为了获得最佳结果而对所有参数进行微调也非常乏味而且耗时。而且有可能在你做完所有这些艰苦的工作后,才发现从一开始就选择了错误的分类器。
Python
1
star