当前位置:网站首页>Deep learning - make your own dataset
Deep learning - make your own dataset
2022-07-07 17:41:00 【AI cannon fodder】
1. background
For folder set subfolders , There are many images of the same category in the subfolder , Subfolders represent the categories of images inside . The file with this structure is called image cascading, which is imageFolder. As shown below :
![]()
Under this folder are 10 Subfolders of categories , as follows :
There are many images under each subfolder , as follows :

2. Start making dataset
"""
There are multiple folders under one folder , Each subfolder is the class alias of the pictures in the subfolder , This kind of appellation image stacking form imageFolder.
"""
import os
from torch.utils.data import Dataset, DataLoader, random_split
import pandas as pd
import numpy as np
dataset_dir = "F:/reshape_images"
# Get the number of subfolders , That is, the number of categories
classes = os.listdir(dataset_dir)
print(classes)
# Define an array to store filename, filepath, label, So the definition of 边栏推荐
猜你喜欢
随机推荐
原生js验证码
责任链模式 - Unity
麒麟信安携异构融合云金融信创解决方案亮相第十五届湖南地区金融科技交流会
麒麟信安云平台全新升级!
第3章业务功能开发(安全退出)
无法链接远程redis服务器(解决办法百分百)
【信息安全法律法規】複習篇
第3章业务功能开发(用户访问项目)
Toast will display a simple prompt message on the program interface
自动化测试:Robot FrameWork框架大家都想知道的实用技巧
机器人工程终身学习和工作计划-2022-
本周小贴士131:特殊成员函数和`= default`
《世界粮食安全和营养状况》报告发布:2021年全球饥饿人口增至8.28亿
漫画 | 宇宙第一 IDE 到底是谁?
【网络攻防原理与技术】第5章:拒绝服务攻击
【网络攻防原理与技术】第6章:特洛伊木马
【重新理解通信模型】Reactor 模式在 Redis 和 Kafka 中的应用
专精特新软件开发类企业实力指数发布,麒麟信安荣誉登榜
VSCode关于C语言的3个配置文件
Solid function learning









