I have downlaoded the files using pb_url = “https://github.com/spmallick/learnopencv/raw/master/FaceDetectionComparison/models/opencv_face_detector.pb”
pbtxt_url = “https://github.com/spmallick/learnopencv/raw/master/FaceDetectionComparison/models/opencv_face_detector.pbtxt”
Local filenames
pb_file = “opencv_face_detector.pb”
pbtxt_file = “opencv_face_detector.pbtxt”
And yes I have the files in the right directory, my program keeps saying "C:\Users\adimalaa\AppData\Local\Programs\Python\Python311\python.exe “C:\Users\adimalaa\PycharmProjects\Marine vessel\DNN_module.py”
Traceback (most recent call last):
File “C:\Users\adimalaa\PycharmProjects\Marine vessel\DNN_module.py”, line 17, in
face_net = cv2.dnn.readNetFromTensorflow(‘opencv_face_detector.pb’, ‘opencv_face_detector.pbtxt’)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.11.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\tensorflow\tf_io.cpp:42: error: (-2:Unspecified error) FAILED: ReadProtoFromBinaryFile(param_file, param). Failed to parse GraphDef file: opencv_face_detector.pb in function ‘cv::dnn::ReadTFNetParamsFromBinaryFileOrDie’
Process finished with exit code 1"