deep learning with opencv

furthermore, this API for using pre-trained deep learning models is compatible with both the C++ API and the python bindings, making it dead simple to:
(1)load a model from disk
(2)pre-process an input image
(3)pass the image through the network and obtain the output classifications


in the remainder of this blog post i'll demonstrate the fundamentals of how to take a pre-trained deep learning network on the ImageNet dataset and apply it to input images


we'll then write a python script that will use opencv and GoogleLeNet (pre-trained on ImageNet) to classify images


with opencv3.3, we can utilize pre-trained networks with popular deep learning frameworks. the fact that they are pre-trained implies that we don't need to spend many hours training the network--rather we can complete a forward pass and utilize the output to make a decision within our application


since a network (such as a CNN) can be used as a classifier, it makes logical sense that OpenCV has a deep learning module that we can leverage easily within the opencv ecosystem


popular network architectures compatible with Opencv3.3 include:
(1)GoogleLeNet
(2)AlexNet
(3)SqueezeNet
(4)VGGNet
(5)ResNet


using opencv3.3 we can load images from disk using the following functions inside dnn:
(1)cv2.dnn.blobFromImage
(2)cv2.dnn.blobFromImages


we can directly import models from various frameworks via the create methods:
(1)cv2.dnn.createCaffeImporter
(2)cv2.dnn.createTensorFlowImporter
(3)cv2.dnn.createTorchImporter


i thick it's easier to simply use the read methods and load a serialized model from disk directly:
(1)cv2.dnn.readNetFromCaffe
(2)cv2.dnn.readNetFromTensorFlow
(3)cv2.dnn.readNetFromTorch
(4)cv2.dnn.readTorchBlob


once we have loaded a model from disk, the .forward method is used to forward-propagate our image and obtain the actual classification


the GoogleLeNet architecture (now known as "inception" after the novel micro-architecture) Going deeper with convolutions (2014)


if you are familiar with Caffe, you;ll recognize the prototxt file as a plain text configuration which follows a JSON-like structure
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值