Код: Выделить всё
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
image_path='/files'
images = []
for filename in os.listdir(image_path):
img = cv2.imread(os.path.join(image_path,filename))
images.append(img)
# print(len(images))
# print('data shape:', np.array(images).shape)
for img in images:
data = np.array(img)
print(data.shape)
plt.imshow(data)
plt.show()
Подробнее здесь: https://stackoverflow.com/questions/768 ... m-a-folder