From the course: Introduction to Deep Learning with OpenCV
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Classification for an image: Inference - OpenCV Tutorial
From the course: Introduction to Deep Learning with OpenCV
Classification for an image: Inference
- [Instructor] So we've loaded the different classes of ImageNet and we're going to use the OpenCV DNN module as an inference engine. What we're going to do here is pass an image through a pre-trained model that has been trained on the 1,000 classes of ImageNet. The model will then output the probability the image contains each of the 1,000 classes. So let's head over to our editor, and let's load the Caffe model, and let's comment out the classes because we've confirmed that we can display the different classes. Now if you open the prototxt file in the model folder. So I do File, Open File and open this prototext file here. You'll find the deep learning architecture of the module is a JSON like structure. The pretrained model is in the Caffe model file. Both of these files are in the model folder and I downloaded them from the Caffe zoo. So let's read in these Caffe files, so I'm going to head back to the image file and I type in cv2.dnn.readNetFromCaffe and I need to enter the paths…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.