【发布时间】:2020-11-27 12:48:59
【问题描述】:
您好,我有来自共享文件夹的图像数据集。像这样的数据集路径:/media/sharing_folder/data 和数据文件夹有两个子文件夹,分别是“屏蔽”和“未屏蔽”。我尝试像这样导入数据:
data = []
def create_data():
for category in CATEGORIES:
path = os.path.join(DATADIR, category) #path to masked or unmasked dir
class_num = CATEGORIES.index(category)
for img in os.listdir(path):
try:
img_array = cv2.imread(os.path.join(path,img), cv2.IMREAD_GRAYSCALE)
new_array = cv2.resize(img_array, (IMG_SIZE, IMG_SIZE))
data.append([new_array, class_num])
except Exception as e:
pass
create_data()
但是,此导入运行非常缓慢。我想用 tensorflowio 导入数据。如何使用 tensorflowio 导入?
【问题讨论】:
标签: tensorflow image-processing import deep-learning imagedata