【发布时间】:2021-02-21 07:05:01
【问题描述】:
在为图像分类问题拟合卷积神经网络时,为了使用类似的函数
flow_from_directory()
image_dataset_from_directory()
Keras 期望火车数据以这种方式存储:
\data:
\training
\class_1
"imag1.jpg"
"imag2.jpg"
...
\class_2
"imag1.jpg"
"imag2.jpg"
...
....
相反,我有一个数据集,其中所有图像都存储在一个文件夹中,还有一个 .json 文件,其中包含从文件名到标签的映射。类似的东西
{"18985.jpg": 0, "43358.jpg": 0, ... "13163.jpg": 1 ....}
有没有一种有效的方法来使用这个数据集?
【问题讨论】:
-
你想像那样使用这些文件,或者你想把它变成配置 image_dataset_from_directory 期望?
-
@AlexandreCatalano 两种方式都会很好
-
我试过了告诉我是否有帮助:)
标签: python tensorflow image-processing keras