I have error related to simple object detection .
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
IndexError: invalid index to scalar variable.
import cv2.cv2 as cv
import numpy as np
# Load Yolo
net = cv.dnn.readNet('yolov3.weights','yolov3.cfg')
classes = []
with open ("coco.names","r") as f:
classes = [line.strip() for line in f.readlines()]
layer_names = net.getLayerNames()
otputlayers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
#Loading image
img = cv.imread("room_ser.jpg")
cv.imshow("Image",img)
cv.waitKey(0)
cv.destroyAllWindows()