当前位置:网站首页>Pytoch through datasets Imagefolder loads datasets directly from files
Pytoch through datasets Imagefolder loads datasets directly from files
2022-07-05 12:26:00 【Dongcheng West que】
tf = transforms.Compose([
transforms.Resize((64,64)),
transforms.ToTensor(),
])
db=torchvision.datasets.ImageFolder(root="pokemon",transform=tf)
loader=DataLoader(db,batch_size=32,shuffle=True)
print("make-code",db.class_to_idx)
for x, y in loader:
viz.images(x, nrow=8, win="batch", opts=dict(title="batch"))
viz.text(str(y.numpy()), win="lablel", opts=dict(title="batch-y"))
time.sleep(10)
边栏推荐
- Deep discussion on the decoding of sent protocol
- Four operations and derivative operations of MATLAB polynomials
- Hexadecimal conversion summary
- Redis highly available sentinel mechanism
- Why learn harmonyos and how to get started quickly?
- Knowledge representation (KR)
- Matlab struct function (structure array)
- Which domestic cloud management platform manufacturer is good in 2022? Why?
- Average lookup length when hash table lookup fails
- MySQL splits strings for conditional queries
猜你喜欢

Understand kotlin from the perspective of an architect

Redis clean cache

强化学习-学习笔记3 | 策略学习

About cache exceptions: solutions for cache avalanche, breakdown, and penetration

Matlab superpixels function (2D super pixel over segmentation of image)

What is digital existence? Digital transformation starts with digital existence

How can beginners learn flutter efficiently?
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"

Take you hand in hand to develop a service monitoring component

7月华清学习-1
随机推荐
手机 CPU 架构类型了解
强化学习-学习笔记3 | 策略学习
Implementing Yang Hui triangle with cyclic queue C language
MySQL log module of InnoDB engine
Application of a class of identities (vandermond convolution and hypergeometric functions)
IPv6与IPv4的区别 网信办等三部推进IPv6规模部署
Redis highly available sentinel cluster
How to design an interface?
II. Data type
ZABBIX monitors mongodb templates and configuration operations
Learn garbage collection 01 of JVM -- garbage collection for the first time and life and death judgment
C language structure is initialized as a function parameter
Array cyclic shift problem
What is digital existence? Digital transformation starts with digital existence
[hdu 2096] Xiaoming a+b
Automated test lifecycle
Acid transaction theory
MVVM framework part I lifecycle
Redis highly available slice cluster
The evolution of mobile cross platform technology