Go through the following steps:
- Import the modules:
import cv2import numpy as np
- Load a Caffe model:
net_caffe = cv2.dnn.readNetFromCaffe('../data/bvlc_googlenet.prototxt', '../data/bvlc_googlenet.caffemodel')
- Load a model from Torch:
net_torch = cv2.dnn.readNetFromTorch('../data/torch_enet_model.net')
- Read and parse a TensorFlow trained model:
net_tensorflow = cv2.dnn.readNetFromTensorflow('../data/tensorflow_inception_graph.pb')