i'm having a problem on reading a path that contains a group of images, i have the paths on my desktop but i can't read them
Can you guys help me?
I have the exact code on a computers friend and it runs perfeclty
where is the code
Can you guys help me?
I have the exact code on a computers friend and it runs perfeclty
where is the code
from sklearn.decomposition import NMF from matplotlib import pyplot as plt import cv2 import numpy as np import os import sys import statistics ## upload imgs e returns names e imgs def uploadImg(dir1,dir2): cityscape_original = [] landscape_original = [] nameList = [[] for _ in range(512)] imgList = [[] for _ in range(512)] for file in os.listdir('./Desktop/landscape'): if file.endswith(".jpg"): nameList[0].append(file) orig = cv2.imread('./Desktop/landscape' + file) orig = cv2.cvtColor(orig, cv2.COLOR_BGR2RGB) cityscape = cv2.resize(orig,(512,512)) #cityscape_original.append(cityscape) imgList[0].append(cityscape) for file in os.listdir('./Desktop/cityscape'): if file.endswith(".jpg"): nameList[1].append(file) orig = cv2.imread('./sktop/cityscape' + file) orig = cv2.cvtColor(orig, cv2.COLOR_BGR2RGB) landscape = cv2.resize(orig,(512,512)) #landscape_original.append(landscape) imgList[1].append(landscape) return nameList,imgList dir1 = os.listdir('./Desktop/cityscape') dir2 = os.listdir('./Desktop/landscape') name,img = uploadImg(dir1, dir2)And this is my error
Error:FileNotFoundError Traceback (most recent call last)
<ipython-input-8-d8d91223d726> in <module>
----> 1 dir1 = os.listdir('./Desktop/cityscape')
2 dir2 = os.listdir('./Desktop/landscape')
3 name,img = uploadImg(dir1, dir2)
FileNotFoundError: [WinError 3] The system cannot find the path specified: './Desktop/cityscape'
thanks for the support