当前位置:网站首页>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
边栏推荐
猜你喜欢
专精特新软件开发类企业实力指数发布,麒麟信安荣誉登榜
YARN Capacity Scheduler容量调度器(超详细解读)
Vscode three configuration files about C language
【TPM2.0原理及应用指南】 16、17、18章
【深度学习】3分钟入门
企业经营12法的领悟
Face recognition attendance system based on Baidu flying plasma platform (easydl)
第3章业务功能开发(实现记住账号密码)
Lex & yacc of Pisa proxy SQL parsing
【TPM2.0原理及应用指南】 9、10、11章
随机推荐
Ansible 学习总结(9)—— Ansible 循环、条件判断、触发器、处理失败等任务控制使用总结
第二十四届中国科协湖南组委会调研课题组一行莅临麒麟信安调研考察
在窗口上面显示进度条
Functions and usage of viewflipper
viewflipper的功能和用法
LeetCode 648(C#)
如何在软件研发阶段落地安全实践
麒麟信安云平台全新升级!
鲲鹏开发者峰会2022 | 麒麟信安携手鲲鹏共筑计算产业新生态
百度地图自定义样式向右拖拽导致全球地图经度0度无法正常显示
Pytorch中自制数据集进行Dataset重写
【TPM2.0原理及应用指南】 12、13、14章
zdog.js火箭转向动画js特效
字符串 - string(Lua)
[distributed theory] (I) distributed transactions
LeetCode 515(C#)
企业经营12法的领悟
面试官:页面很卡的原因分析及解决方案?【测试面试题分享】
Ratingbar的功能和用法
基于PyTorch利用CNN对自己的数据集进行分类