from imutils.video import VideoStream
from imutils.video import FPS
import argparse
import imutils
import time
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", type=str,help="path to input video file",)
ap.add_argument("-t", "--tracker", required=False,type=str, default="kcf", help="OpenCV object tracker type")
args = vars(ap.parse_args())
答案 0 :(得分:0)
如果您希望此代码在Google Collab上正常运行,则应在ArgumentParser
中添加一个附加的参数选项:
from imutils.video import VideoStream
from imutils.video import FPS
import argparse
import imutils
import time
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", type=str,help="path to input video file",)
ap.add_argument("-t", "--tracker", required=False,type=str, default="kcf", help="OpenCV object tracker type")
ap.add_argument("-f", "--file", required=False)
args = vars(ap.parse_args())