在好例子网,分享、交流、成长!
您当前所在位置:首页Python 开发实例Python语言基础 → Deep Learning for Computer Vision with Python ImageNet Bundle.pdf

Deep Learning for Computer Vision with Python ImageNet Bundle.pdf

Python语言基础

下载此实例
  • 开发语言:Python
  • 实例大小:25.82M
  • 下载次数:14
  • 浏览次数:73
  • 发布时间:2020-10-30
  • 实例类别:Python语言基础
  • 发 布 人:wanxiaowu
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: Computer python python Vision Image

实例介绍

【实例简介】Deep Learning for Computer Vision with Python ImageNet Bundle 书籍

【实例截图】

from clipboard

【核心代码】

Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3 Training Networks Using Multiple GPUs . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1 How Many GPUs Do I Need? 17
3.2 Performance Gains Using Multiple GPUs 18
3.3 Summary 19
4 What Is ImageNet? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.1 The ImageNet Dataset 21
4.1.1 ILSVRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 Obtaining ImageNet 23
4.2.1 Requesting Access to the ILSVRC Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2.2 Downloading Images Programmatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2.3 Using External Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2.4 ImageNet Development Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2.5 ImageNet Copyright Concerns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3 Summary 27
5 Preparing the ImageNet Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.1 Understanding the ImageNet File Structure 29
5.1.1 ImageNet “test” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.1.2 ImageNet “train” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1.3 ImageNet “val” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.1.4 ImageNet “ImageSets” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.1.5 ImageNet “DevKit” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.2 Building the ImageNet Dataset 37
5.2.1 Your First ImageNet Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.2.2 Our ImageNet Helper Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.2.3 Creating List and Mean Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2.4 Building the Compact Record Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.3 Summary 52
6 Training AlexNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.1 Implementing AlexNet 54
6.2 Training AlexNet 58
6.2.1 What About Training Plots? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.2.2 Implementing the Training Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.3 Evaluating AlexNet 65
6.4 AlexNet Experiments 67
6.4.1 AlexNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.4.2 AlexNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.4.3 AlexNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.5 Summary 74
7 Training VGGNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.1 Implementing VGGNet 76
7.2 Training VGGNet 81
7.3 Evaluating VGGNet 85
7.4 VGGNet Experiments 86
7.5 Summary 88
8 Training GoogLeNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8.1 Understanding GoogLeNet 89
8.1.1 The Inception Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
8.1.2 GoogLeNet Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
8.1.3 Implementing GoogLeNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.1.4 Training GoogLeNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.2 Evaluating GoogLeNet 99
8.3 GoogLeNet Experiments 99
8.3.1 GoogLeNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8.3.2 GoogLeNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
8.3.3 GoogLeNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.4 Summary 103
9 Training ResNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.1 Understanding ResNet 105
9.2 Implementing ResNet 106
9.3 Training ResNet 112
9.4 Evaluating ResNet 116
9.5 ResNet Experiments 116
9.5.1 ResNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
9.5.2 ResNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
9.5.3 ResNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.6 Summary 120
10 Training SqueezeNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
10.1 Understanding SqueezeNet 121
10.1.1 The Fire Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
10.1.2 SqueezeNet Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
10.1.3 Implementing SqueezeNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
10.2 Training SqueezeNet 128
10.3 Evaluating SqueezeNet 132
10.4 SqueezeNet Experiments 132
10.4.1 SqueezeNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
10.4.2 SqueezeNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
10.4.3 SqueezeNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
10.4.4 SqueezeNet: Experiment #4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
10.5 Summary 139
11 Case Study: Emotion Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
11.1 The Kaggle Facial Expression Recognition Challenge 141
11.1.1 The FER13 Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
11.1.2 Building the FER13 Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
11.2 Implementing a VGG-like Network 147
11.3 Training Our Facial Expression Recognizer 150
11.3.1 EmotionVGGNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
11.3.2 EmotionVGGNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
11.3.3 EmotionVGGNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
11.3.4 EmotionVGGNet: Experiment #4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
11.4 Evaluating our Facial Expression Recognizer 157
11.5 Emotion Detection in Real-time 159
11.6 Summary 163
12 Case Study: Correcting Image Orientation . . . . . . . . . . . . . . . . . . . . 165
12.1 The Indoor CVPR Dataset 165
12.1.1 Building the Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
12.2 Extracting Features 170
12.3 Training an Orientation Correction Classifier 173
12.4 Correcting Orientation 175
12.5 Summary 177
13 Case Study: Vehicle Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
13.1 The Stanford Cars Dataset 179
13.1.1 Building the Stanford Cars Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
13.2 Fine-tuning VGG on the Stanford Cars Dataset 187
13.2.1 VGG Fine-tuning: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
13.2.2 VGG Fine-tuning: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
13.2.3 VGG Fine-tuning: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
13.3 Evaluating our Vehicle Classifier 195
13.4 Visualizing Vehicle Classification Results 197
13.5 Summary 201
14 Case Study: Age and Gender Prediction . . . . . . . . . . . . . . . . . . . . . . 203
14.1 The Ethics of Gender Identification in Machine Learning 203
14.2 The Adience Dataset 204
14.2.1 Building the Adience Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
14.3 Implementing Our Network Architecture 219
14.4 Measuring “One-off” Accuracy 221
14.5 Training Our Age and Gender Predictor 224
14.6 Evaluating Age and Gender Prediction 227
14.7 Age and Gender Prediction Results 230
14.7.1 Age Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
14.7.2 Gender Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
14.8 Visualizing Results 233
14.8.1 Visualizing Results from Inside Adience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
14.8.2 Understanding Face Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
14.8.3 Applying Age and Gender Prediction to Your Own Images . . . . . . . . . . . . . . 240
14.9 Summary 244
15 Faster R-CNNs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
15.1 Object Detection and Deep Learning 247
15.1.1 Measuring Object Detector Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
15.2 The (Faster) R-CNN Architecture 250
15.2.1 A Brief History of R-CNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
15.2.2 The Base Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
15.2.3 Anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
15.2.4 Region Proposal Network (RPN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
15.2.5 Region of Interest (ROI) Pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
15.2.6 Region-based Convolutional Neural Network . . . . . . . . . . . . . . . . . . . . . . . . . 259
15.2.7 The Complete Training Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
15.3 Summary 260
16 Training a Faster R-CNN From Scratch . . . . . . . . . . . . . . . . . . . . . . . . . 261
16.1 The LISA Traffic Signs Dataset 261
16.2 Installing the TensorFlow Object Detection API 262
16.3 Training Your Faster R-CNN 263
16.3.1 Project Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
16.3.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
16.3.3 A TensorFlow Annotation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
16.3.4 Building the LISA   TensorFlow Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
16.3.5 A Critical Pre-Training Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
16.3.6 Configuring the Faster R-CNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
16.3.7 Training the Faster R-CNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
16.3.8 Suggestions When Working with the TFOD API . . . . . . . . . . . . . . . . . . . . . . . . 282
16.3.9 Exporting the Frozen Model Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
16.3.10 Faster R-CNN on Images and Videos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
16.4 Summary 290
17 Single Shot Detectors (SSDs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
17.1 Understanding Single Shot Detectors (SSDs) 293
17.1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
17.1.2 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
17.1.3 MultiBox, Priors, and Fixed Priors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
17.1.4 Training Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
17.2 Summary 297
18 Training a SSD From Scratch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
18.1 The Vehicle Dataset 299
18.2 Training Your SSD 300
18.2.1 Directory Structure and Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
18.2.2 Building the Vehicle Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
18.2.3 Training the SSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
18.2.4 SSD Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
18.2.5 Potential Problems and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
18.3 Summary 312
19 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
19.1 Where to Now? 314

实例下载地址

Deep Learning for Computer Vision with Python ImageNet Bundle.pdf

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警