text_plain_output_2.png text_plain_output_1.png image_output_1.png
from PIL import Image

train_cat = '../input/training_set/training_set/cats'
train_dog = '../input/training_set/training_set/dogs'
test_cat = '../input/test_set/test_set/cats'
test_dog = '../input/test_set/test_set/dogs'
image_size = 128

Image.open(train_cat + '/' + 'cat.1.jpg')

Image.open('../input/training_set/training_set/dogs/dog.1.jpg')

minh, minv = (100000, 100000)
for p in range(1, 4001):
    pic = Image.open(train_cat + '/' + 'cat.' + str(p) + '.jpg')
    if pic.size[0] < minh:
        minh = pic.size[0]
    if pic.size[1] < minv:
        minv = pic.size[1]
for u in range(1, 4001):
    pic = Image.open(train_dog + '/' + 'dog.' + str(u) + '.jpg')
    if pic.size[0] < minh:
        minh = pic.size[0]
    if pic.size[1] < minv:
        minv = pic.size[1]
print(minh)
print(minv)