runfile(‘E:/machine learning/ML IP CV Course code/computer_vision/mobiledetection/Object_Detection_Files/mobile.py’, wdir=‘E:/machine learning/ML IP CV Course code/computer_vision/mobiledetection/Object_Detection_Files’)
error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-kh7iq4w7\opencv\modules\dnn\src\tensorflow\tf_io.cpp:42: error: (-2:Unspecified error) FAILED: ReadProtoFromBinaryFile(param_file, param). Failed to parse GraphDef file: E:\machine learning\ML IP CV Course code\computer_vision\mobiledetection\Object_Detection_Files\frozen_inference_graph.pb in function ‘cv::dnn::ReadTFNetParamsFromBinaryFileOrDie’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “E:\machine learning\ML IP CV Course code\computer_vision\mobiledetection\Object_Detection_Files\mobile.py”, line 24, in
net = cv2.dnn_DetectionModel(weightsPath,configPath)
SystemError: <class ‘cv2.dnn_DetectionModel’> returned a result with an error set
GETTING ERROR WHILE RUNNING THIS CODE
import cv2
thres = 0.45 # Threshold to detect object
cap = cv2.VideoCapture(0)
cap.set(3,648)
cap.set(4,480)
classNames= []
classFile = 'coco.names'
with open(classFile,'rt') as f:
classNames = f.read().rstrip("\n").split("\n")
configPath = 'ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt'
weightsPath = 'frozen_inference_graph.pb'
net = cv2.dnn_DetectionModel(weightsPath,configPath)
ANYONE HELP