当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
[tpm2.0 principle and Application guide] Chapter 1-3
Notification is the notification displayed in the status bar of the phone
Audio Device Strategy 音频设备输出、输入 选择 基于7.0 代码
做软件测试 掌握哪些技术才能算作 “ 测试高手 ”?
Function and usage of textswitch text switcher
<代码随想录二刷>链表
Devops' operational and commercial benefits Guide
原生js验证码
第3章业务功能开发(安全退出)
带动画的列表选中js特效
【网络攻防原理与技术】第5章:拒绝服务攻击
L1-028 判断素数(Lua)
【TPM2.0原理及应用指南】 12、13、14章
2021-06-28
第2章搭建CRM项目开发环境(数据库设计)
测试3个月,成功入职 “字节”,我的面试心得总结
zdog.js火箭转向动画js特效
请将磁盘插入“U盘(H)“的情况&无法访问 磁盘结构损坏且无法读取
自动化测试:Robot FrameWork框架大家都想知道的实用技巧
Cartoon | who is the first ide in the universe?