I want to know the size of the image, the solution is the following, using pgmagick I open the images and save it into an array:
img = Image('image_1.jpeg') and using numpy find out the size
width=np.size(img,0) height = np.size(img,1) As a result, I see the following error:
Traceback (most recent call last): File "/home/alex/PycharmProjects/untitled/create_file_annotation.py", line 56, in width = np.size (img, 0) File "/usr/lib/python2.7/dist -packages / numpy / core / fromnumeric.py ", line 2702, in size return asarray (a) .shape [axis] IndexError: tuple index out of range
And the most interesting thing is that I set print weight,height and the image size is correct before an error, what could be the cause of the error? Python using version 2.7