当前位置:网站首页>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()边栏推荐
- Hiengine: comparable to the local cloud native memory database engine
- Yum only downloads the RPM package of the software to the specified directory without installing it
- JS for loop number exception
- Array cyclic shift problem
- 一款新型的智能家居WiFi选择方案——SimpleWiFi在无线智能家居中的应用
- Constructing expression binary tree with prefix expression
- Semantic segmentation experiment: UNET network /msrc2 dataset
- Anaconda creates a virtual environment and installs pytorch
- Open3d mesh (surface) coloring
- Solve the error 1045 of Navicat creating local connection -access denied for user [email protected] (using password
猜你喜欢
Take you two minutes to quickly master the route and navigation of flutter

Interviewer: is acid fully guaranteed for redis transactions?
[email protected] (using password"/>Solve the error 1045 of Navicat creating local connection -access denied for user [email protected] (using password

Anaconda creates a virtual environment and installs pytorch

Mmclassification training custom data
Why do you always fail in automated tests?

mysql拆分字符串做条件查询
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter

Flutter2 heavy release supports web and desktop applications

报错ModuleNotFoundError: No module named ‘cv2.aruco‘
随机推荐
Complete activity switching according to sliding
Take you two minutes to quickly master the route and navigation of flutter
JS for循环 循环次数异常
Semantic segmentation experiment: UNET network /msrc2 dataset
Video networkstate property
MySQL constraints
byte2String、string2Byte
Flutter2 heavy release supports web and desktop applications
[pytorch pre training model modification, addition and deletion of specific layers]
Redis highly available slice cluster
Want to ask, how to choose a securities firm? Is it safe to open an account online?
Video networkState 属性
Swift - add navigation bar
Get the variable address of structure member in C language
Experimental design - using stack to realize calculator
Matlab struct function (structure array)
MySQL function
ZABBIX agent2 installation
Xi IO flow
MySQL transaction