当前位置:网站首页>[pytoch] learning notes (I) create your own data set
[pytoch] learning notes (I) create your own data set
2022-07-21 19:01:00 【High and small】
Custom datasets
If you want to use your own data set , Must be realized 3 A way : __init__()
,__len__()
And __getitem__()
.___init__()
:
Call once when initializing the dataset , We initialize some data in the initialization method , for example , Initialize image path , Initialization of annotation file and data preprocessing .__len__()
:
Returns the amount of data in the dataset __getitem__()
:__getitem__()
According to the given idx, Load and then return a sample . be based on idx, Find the picture and convert it to tensor. Traverse label, Call custom transform Function to complete image preprocessing . Eventually return tensor Materialized picture and corresponding tag tuple .
边栏推荐
- 纯干货内容:关于ivx和mendix的对比 还在犹豫选择那个低代码平台的小伙伴看过来
- The problem of removing spaces at the beginning and end of strings
- STM32F40x 最小系统
- 刷题笔记-查找
- oracle 启动命令
- Oracle startup command
- The risk control data (model) is not bothered because of the processing skills in this flow process
- rk3128扬声器spk 和耳机hp声音大小调试
- Test the mock data method of knowing and knowing
- Embedded learning: introduction to Cortex-M series chips
猜你喜欢
随机推荐
王者荣耀商城异地多活架构设计
ClickHouse表引擎
生成二维码
循环结构--while循环和do-while循环
下一代无线局域网--802.11n与传统11ag OFDM设备间的PHY互操作性
Part I - Fundamentals of C language_ 10. Document operation
Day009循环结构(练习)
Graylog distributed log component to improve the efficiency of log checking!
Hongmeng harmonios deveco studio reported an error unistall_ FAILED_ INTERNAL_ ERROR
鸿蒙 harmonyos DevEco-Studio 报错 UNINSTALL_FAILED_INTERNAL_ERROR
NFS共享
C语言运算符
Streamlit 数据科学必备工具
嵌入式学习:Cortex-M系列芯片介绍
字符串首尾空格去除问题
C语言常量与变量
Visual solution of digital twin landing high-speed railway bridge
若依框架之swagger接口文档
刷题笔记-查找
【Pytorch】学习笔记(一)创建自己的数据集