Ошибка dnn: (-201: неправильный размер входного массива) Несогласованная форма для ConcatLayer в функции 'getMemoryShapes'
Я взял этот код из https://github.com/saimj7/People-Counting-in-Real-Time/blob/master/Run.py и пытаюсь использовать YOLOv4 вместо используемой модели SSD. Я внес несколько изменений, но все еще сталкиваюсь со следующими ошибками:
dnn error: (-201:Incorrect size of input array) Inconsistent shape for ConcatLayer in function 'getMemoryShapes'
Кто-нибудь, пожалуйста, скажите мне, что я здесь делаю не так.
Вот изменения, которые я внес в код:
def run():
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--input", required=True,
help="path to input video")
ap.add_argument("-p", "--prototxt", required=False,
help="path to coco.names 'deploy' file")
ap.add_argument("-o", "--output", required=True,
help="path to output video")
ap.add_argument("-c", "--confidence", type=float, default=0.4,
help="minimum probability to filter weak detections")
ap.add_argument("-s", "--skip-frames", type=int, default=30,
help="# of skip frames between detections")
args = vars(ap.parse_args())
CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat",
"bottle", "bus", "car", "cat", "chair", "cow", "diningtable",
"dog", "horse", "motorbike", "person", "pottedplant", "sheep",
"sofa", "train", "tvmonitor"]
# derive the paths to the YOLO weights and model configuration
weightsPath = "./yolov4.weights"
configPath = "./cfg/yolov4.cfg"
metaPath = "./yolo-coco/coco.names"
# load our serialized model from disk
net = cv2.dnn.readNetFromDarknet(configPath, weightsPath)