gpt4 book ai didi

python - OpenCV错误:参数-p/-prototxt是必需的

转载 作者:行者123 更新时间:2023-12-02 17:34:46 26 4
gpt4 key购买 nike

在python 2.7中运行以下代码会给我这个错误:

用法:real_time_object_detection.py [-h] -p PROTOTXT -m模型[-c CONFIDENCE]
real_time_object_detection.py:错误:参数-p /-prototxt是必需的

其中real_time_object_detection.py是正在运行的文件的名称。有什么建议么?

from imutils.video import VideoStream
from imutils.video import FPS
import numpy as np
import argparse
import imutils
import time
import cv2

ap = argparse.ArgumentParser()
ap.add_argument("-p", "--prototxt", required=True,
help="path to Caffe 'deploy' prototxt file")
ap.add_argument("-m", "--model", required=True,
help="path to Caffe pre-trained model")
ap.add_argument("-c", "--confidence", type=float, default=0.2,
help="minimum probability to filter weak detections")
args = vars(ap.parse_args())

上面的代码是我从这里获得的代码的一部分:

https://www.pyimagesearch.com/2017/09/18/real-time-object-detection-with-deep-learning-and-opencv/

Also a screenshot might help

最佳答案

程序文件中存在参数prototxt和caffemodel,使用此行在终端中运行它。

python object_tracker.py --prototxt deploy.prototxt --model res10_300x300_ssd_iter_140000.caffemodel

关于python - OpenCV错误:参数-p/-prototxt是必需的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52318259/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com