# load our serialized model from disk print("[INFO] loading model...") net = cv2.dnn.readNet(args["model"]) # load the input image, resize it, and construct a blob from it, # but keeping mind mind that the original input image dimensions # ENet was trained on was 1024x512 image = cv2.imread(args["image"]) image = imutils.resize(image, width=args["width"]) blob = cv2.dnn.blobFromImage(image, 1 / 255.0, (1024, 512), 0, swapRB=True, crop=False) # perform a forward pass using the segmentation model net.setInput(blob) start = time.time() output = net.forward() end = time.time() # show the amount of time inference took print("[INFO] inference took {:.4f} seconds".format(end - start))