图像分类 - 在序列模型中使用字典数据集
我正在构建一个基本的图像分类项目。但是,我的数据集是一个字典,其中标签作为键,相应图像作为值。 {'label_name1': ['imagepath1', 'imagepath2',....], 'label_name2': ['imagepath1', 'image2path',....],....}
如何预处理此类数据集,然后在顺序分类模型中使用它。
I am building a basic Image Classification Project. However, my data set is a dictionary of labels as keys and respective images as values.{'label_name1': ['imagepath1', 'imagepath2',....], 'label_name2': ['imagepath1', 'image2path',....],....}
How can I preprocess this kind of data set and later on use it in a Sequential Classification Model.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用一些 for 循环将字典分成 2 个并行列表。
奖金:
然后,您可以通过将列表压缩在一起来并行打乱图像和标签。
You can separate the dictionary into 2 parallel lists with some for loops.
Bonus:
You can then shuffle the images and labels in parallel by zipping the lists together.