gpt4 book ai didi

python - 无法打开 prototxt

转载 作者:行者123 更新时间:2023-12-02 16:36:01 25 4
gpt4 key购买 nike

   protoPath = os.path.sep.join([r"C:\Users\osama\Desktop\opencv-face recognitio\face_detection_model", 
"deploy.prototxt.txt"])
modelPath = os.path.sep.join([r"C:\Users\osama\Desktop\opencv-face-recognitio\face_detection_model",
"res10_300x300_ssd_iter_140000.caffemodel"])
detector = cv2.dnn.readNetFromCaffe(protoPath, modelPath)

这是密码,但我尝试了所有方法,但仍然无法打开它

detector = cv2.dnn.readNetFromCaffe(protoPath, modelPath)

error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\dnn\src\caffe\caffe_io.cpp:1121: error: (-2:Unspecified error) FAILED: fs.is_open(). Can't open "C:\Users\osama\Desktop\opencv-face-recognitio\face_detection_model\deploy.prototxt.txt" in function 'cv::dnn::ReadProtoFromTextFile

我没有找到任何有用的东西

最佳答案

我被困在这个问题上好几天了。这solution on github终于为我工作了。

from os.path import dirname, join

protoPath = join(dirname(__file__), "deploy.prototxt")
modelPath = join(dirname(__file__), "openCVs_facedetector")

操作系统:windows10

关于python - 无法打开 prototxt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59580608/

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