# load our serialized model from disk print("[INFO] loading model...") net = cv2.dnn.readNet(args["model"]) # initialize the video stream and pointer to output video file vs = cv2.VideoCapture(args["video"]) writer = None # try to determine the total number of frames in the video file try: prop = cv2.cv.CV_CAP_PROP_FRAME_COUNT if imutils.is_cv2() \ else cv2.CAP_PROP_FRAME_COUNT total = int(vs.get(prop)) print("[INFO] {} total frames in video".format(total)) # an error occurred while trying to determine the total # number of frames in the video file except: print("[INFO] could not determine # of frames in video") total = -1