This is the code that i wrote:
img_files = next(os.walk('MyDrive/FYP/Fig_Dataset'))[2]
msk_files = next(os.walk('MyDrive/FYP/Ground_Truth'))[2]
img_files.sort(2)
msk_files.sort(2)
print(len(img_files))
print(len(msk_files))
X = [2]
Y = [2]
for img_fl in tqdm(img_files):
if(img_fl.split('.')[-1]=='jpg'):
img = cv2.imread('MyDrive//FYP/Fig_Dataset/{}'.format(img_fl))
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
resized_img = cv2.resize(img,(256, 192), interpolation = cv2.INTER_CUBIC)
X.append(resized_img)
msk = cv2.imread('MyDrive//FYP/Ground_Truth/{}'.format(img_fl.split('.')[0]+'_segmentation.png'),cv2.IMREAD_GRAYSCALE)
resized_msk = cv2.resize(msk,(256, 192), interpolation = cv2.INTER_CUBIC)
Y.append(resized_msk)
And this is the error that i got
StopIteration Traceback (most recent call last)
<ipython-input-19-40a26ba7758c> in <module>()
----> 1 img_files = next(os.walk('FYP/Fig_Dataset'))[2]
i dont know how to solve this. Help me