I try to run this code (small part of my program) I fixed and added whitespaces and now I get new error, maybe this array does not fit to string?
arrayOfPhotos = ["1.jpg", "2.jpg", "3.jpg", "4.jpg"]
for name in arrayOfPhotos:
detections = detector.detectObjectsFromImage(input_image=arrayOfPhotos[name], output_image_path="holo3-detected.jpg")
for detection in detections:
print(arrayOfPhotos[name], " : ", detection["percentage_probability"])
I get the error:
Traceback (most recent call last):
File "dTEST.py", line 13, in <module>
detections = detector.detectObjectsFromImage(input_image=arrayOfPhotos[name], output_image_path="holo3-detected.jpg")
TypeError: list indices must be integers or slices, not str
Can you help me?