我在classIds, confs, bbox = net.detect(img,confThreshold=float0.5)
面临一个问题
怎么修?请帮忙
我正在尝试运行一个非常简单的OpenCV脚本:
import cv2
img = cv2.imread("index.jpeg")
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)
net.setInputSize(320,320)
net.setInputScale(1.0/ 127.5)
net.setInputMean((127.5, 127.5, 127.5))
net.setInputSwapRB(True)
classIds, confs, bbox = net.detect(img,confThreshold=0.5) #line 19
print(classIds,bbox)
cv2.imshow("Output",img)
cv2.waitKey(0)
提前谢谢
目前没有回答
相关问题 更多 >
编程相关推荐