March 2019
Intermediate to advanced
532 pages
13h 2m
English
Several examples of how to perform image classification using different pre-trained models will be covered in this section. Note that you can get the inference time by using the net.getPerfProfile() method as follows:
# Feed the input blob to the network, perform inference and get the output:net.setInput(blob)preds = net.forward()# Get inference time:t, _ = net.getPerfProfile()print('Inference time: %.2f ms' % (t * 1000.0 / cv2.getTickFrequency()))
As you can see, the net.getPerfProfile() method is called after performing the inference.
Read now
Unlock full access