当前位置:网站首页>Pytorch two-layer loop to realize the segmentation of large pictures
Pytorch two-layer loop to realize the segmentation of large pictures
2022-07-05 12:26:00 【Dongcheng West que】
The size of the large picture is resize(672,1120), Each piece 224x224
for i, (inputs, labels) in enumerate(self.train_data_loader):
crop_img=torch.zeros((5,3))
for ii in range(5):
for j in range(3):
if ii==0 and j==0:
crop_img=inputs[:,:,224*j:224*(j+1),224*ii:224*(ii+1)]
else:
crop_img=torch.cat((crop_img,inputs[:,:,224*j:224*(j+1),224*ii:224*(ii+1)]),0)
grid_img = torchvision.utils.make_grid(crop_img.cpu(), nrow=16)
plt.imshow(grid_img.permute(1, 2, 0))
plt.show()
边栏推荐
- Linux安装部署LAMP(Apache+MySQL+PHP)
- MySQL stored procedure
- What is digital existence? Digital transformation starts with digital existence
- Design of music box based on assembly language
- Array cyclic shift problem
- Which domestic cloud management platform manufacturer is good in 2022? Why?
- Understanding the architecture type of mobile CPU
- [pytorch pre training model modification, addition and deletion of specific layers]
- Master the new features of fluent 2.10
- Time tools
猜你喜欢
What is digital existence? Digital transformation starts with digital existence
Simple production of wechat applet cloud development authorization login
Knowledge representation (KR)
Select drop-down box realizes three-level linkage of provinces and cities in China
Embedded software architecture design - message interaction
Flutter2 heavy release supports web and desktop applications
Hexadecimal conversion summary
Tabbar configuration at the bottom of wechat applet
Why learn harmonyos and how to get started quickly?
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
随机推荐
Understand redis persistence mechanism in one article
Select drop-down box realizes three-level linkage of provinces and cities in China
SENT协议译码的深入探讨
[HDU 2096] 小明A+B
Experimental design - using stack to realize calculator
Video networkState 属性
Solution to order timeout unpaid
GPS data format conversion [easy to understand]
Migrate data from Mysql to neo4j database
Instance + source code = see through 128 traps
Get the variable address of structure member in C language
ZABBIX agent2 installation
Basic operations of MySQL data table, addition, deletion and modification & DML
7月华清学习-1
MySQL index (1)
MySQL data table operation DDL & data type
Master-slave mode of redis cluster
Application of a class of identities (vandermond convolution and hypergeometric functions)
[hdu 2096] Xiaoming a+b
Summary of C language learning problems (VS)