当前位置:网站首页>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
边栏推荐
- 字符串 - string(Lua)
- Define menus using XML resource files
- Share the latest high-frequency Android interview questions, and take you to explore the Android event distribution mechanism
- 本周小贴士#141:注意隐式转换到bool
- 【可信计算】第十二次课:TPM授权与会话
- Audio device strategy audio device output and input selection is based on 7.0 code
- Notification is the notification displayed in the status bar of the phone
- 使用OneDNS完美解决办公网络优化问题
- toast会在程序界面上显示一个简单的提示信息
- Problems encountered in Jenkins' release of H5 developed by uniapp
猜你喜欢
随机推荐
《世界粮食安全和营养状况》报告发布:2021年全球饥饿人口增至8.28亿
阿富汗临时政府安全部队对极端组织“伊斯兰国”一处藏匿点展开军事行动
【信息安全法律法規】複習篇
【网络攻防原理与技术】第5章:拒绝服务攻击
【4500字归纳总结】一名软件测试工程师需要掌握的技能大全
麒麟信安携异构融合云金融信创解决方案亮相第十五届湖南地区金融科技交流会
【网络攻防原理与技术】第4章:网络扫描技术
calendarview日历视图组件的功能和用法
Function and usage of calendar view component
策略模式 - Unity
Ansible learning summary (9) -- ansible loop, condition judgment, trigger, processing failure and other task control use summary
什么是敏捷测试
目标检测1——YOLO数据标注以及xml转为txt文件脚本实战
Function and usage of numberpick
三仙归洞js小游戏源码
状态模式 - Unity(有限状态机)
Lex & yacc of Pisa proxy SQL parsing
机器人工程终身学习和工作计划-2022-
Actionbar navigation bar learning
【TPM2.0原理及应用指南】 1-3章