当前位置:网站首页>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()
边栏推荐
- Matlab struct function (structure array)
- Why learn harmonyos and how to get started quickly?
- The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
- Interviewer: is acid fully guaranteed for redis transactions?
- Tabbar configuration at the bottom of wechat applet
- NPM install reports an error
- 互联网公司实习岗位选择与简易版职业发展规划
- Constructing expression binary tree with prefix expression
- Video networkstate property
- GPS data format conversion [easy to understand]
猜你喜欢
The survey shows that traditional data security tools cannot resist blackmail software attacks in 60% of cases
About cache exceptions: solutions for cache avalanche, breakdown, and penetration
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Take you two minutes to quickly master the route and navigation of flutter
Error modulenotfounderror: no module named 'cv2 aruco‘
ABAP table lookup program
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
Matlab struct function (structure array)
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Learn memory management of JVM 01 - first memory
随机推荐
Seven polymorphisms
Matlab struct function (structure array)
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
图像超分实验:SRCNN/FSRCNN
Correct opening method of redis distributed lock
Principle and performance analysis of lepton lossless compression
Linux安装部署LAMP(Apache+MySQL+PHP)
Understanding the architecture type of mobile CPU
你做自动化测试为什么总是失败?
Select drop-down box realizes three-level linkage of provinces and cities in China
Master the new features of fluent 2.10
Get all stock data of big a
报错ModuleNotFoundError: No module named ‘cv2.aruco‘
Redis's memory elimination mechanism, read this article is enough.
Which domestic cloud management platform manufacturer is good in 2022? Why?
Error modulenotfounderror: no module named 'cv2 aruco‘
PIP command reports an error pip is configured with locations that requires tls/ssl problems
Third party payment interface design
MySQL storage engine