我正在尝试pycharm中的EAST文本检测器,但在第行有一个错误。
(scores, geometry) = net.forward(layerNames)
cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\dnn\src\layers\concat_layer.cpp:95: error: (-201:Incorrect size of input array) Inconsistent shape for ConcatLayer in function 'cv::dnn::ConcatLayerImpl::getMemoryShapes'
代码:
^{pr2}$设置新的宽度和高度,然后确定变化的比率 宽度和高度
(newW, newH) = (375, 500)
rW = W / float(newW)
rH = H / float(newH)
# resize the image and grab the new image dimensions
image = cv2.resize(image, (newW, newH))
orig = image.copy()
(H, W) = image.shape[:2]
net = cv2.dnn.readNet("frozen_east_text_detection.pb")
layerNames = [
"feature_fusion/Conv_7/Sigmoid",
"feature_fusion/concat_3"]
从图像构造一个blob,然后执行 得到两个输出层集的模型
blob = cv2.dnn.blobFromImage(image, 1.0, (W, H),
(123.68, 116.78, 103.94), swapRB=True, crop=False)
start = time.time()
net.setInput(blob)
(scores, geometry) = net.forward(layerNames)
换行
到
^{pr2}$我在opencv4.1.1中也遇到了同样的错误。我正在试着运行这个。我的图像是320x320。在
但当我运行它时,我得到以下错误:
^{pr2}$你不是resizing to a multiple of 32。在
相关问题 更多 >
编程相关推荐