0
import os
import numpy as np
from os import listdir
from PIL import Image
from numpy import asarray

data = np.array([])

path = "training_data"
images = os.listdir(path)

for file in images:
    data = np.append(asarray(file), data)
    
print(data)

This is my code, training_data is a folder which contains a bunch of images, it is under the same parent folder which contains this python file. However, when I print the numpy array, "data" I get "['images']" as output, could someone guide me through this? Thanks in advance!

Emi OB
  • 2,814
  • 3
  • 13
  • 29
Ak110-
  • 1
  • 1

0 Answers0