March 2018
Beginner to intermediate
306 pages
9h 54m
English
You need to perform the following steps:
import cv2import numpy as np
model = cv2.dnn.readNetFromCaffe('../data/bvlc_googlenet.prototxt', '../data/bvlc_googlenet.caffemodel')
print('gflops:', model.getFLOPS((1,3,224,224))*1e-9)
w,b = model.getMemoryConsumption((1,3,224,224))print('weights (mb):', w*1e-6, ', blobs (mb):', b*1e-6)
blob = cv2.dnn.blobFromImage(np.zeros((224,224,3), np.uint8), 1, (224,224))model.setInput(blob)model.forward()
total,timings = model.getPerfProfile() ...