当前位置:网站首页>PSP代码实现
PSP代码实现
2022-06-23 06:18:00 【休斯顿凤梨】
原理:
Backbone+PSP+Prediction
实现:
#代码参考官方
import paddle.fluid as fluid
import numpy as np
np.set_printoptions(precision=2)
x = [ [0.14,0.8,0.34,0.2,0.004,0.31,0.34,0.11],
[0.69,0.51,0.35,0.11,0.22,0.47,0.39,0.92],
[0.64,0.77,0.41,0.08,0.86,0.61,0.41,0.6],
[0.35,0.9,0.07,0.92,0.16,0.78,0.17,0.87],
[0.95,0.44,0.15,0.53,0.89,0.38,0.51,0.08],
[0.93,0.64,0.83,0.37,0.56,0.37,0.68,0.66],
[0.37,0.01,0.58,0.2,0.81,0.75,0.05,0.15],
[0.08,0.66,0.63,0.25,0.18,0.67,0.97,0.34]]
def main():
global x
with fluid.dygraph.guard(fluid.CPUPlace()):
x = np.array(x)
print(x.shape)
print(x)
x = x[np.newaxis,np.newaxis,:,:]
x = fluid.dygraph.to_variable(x)
y = fluid.layers.adaptive_pool2d(input=x,pool_size=[5,3],pool_type='max')
y = y.numpy().squeeze((0,1))
print(y.shape)
print(y)
if __name__ == "__main__":
main()
效果
边栏推荐
- 307. 区域和检索 - 数组可修改
- How to migrate virtual machines from VirtualBox to hype-v
- Business logic design of physical warehouse and virtual warehouse in middle inventory
- 1161 Merging Linked Lists
- 关于五险一金你需要知道的事情
- What are the pension financial products in 2022? Low risk
- 20220621 Three Conjugates of Dual Quaternions
- 316. 去除重复字母
- 产品-Axure9(英文版),原型设计 制作下拉二级菜单
- 318. maximum word length product
猜你喜欢

【项目实训】多段线扩充为平行线

Eureka
![Don't look for [12 super easy-to-use Google plug-ins are here] (are you sure you want to take a look?)](/img/45/3e43faf7aba6741825ccb9719b8445.png)
Don't look for [12 super easy-to-use Google plug-ins are here] (are you sure you want to take a look?)

Configuration and compilation of mingw-w64, msys and ffmpeg

别找了诸位 【十二款超级好用的谷歌插件都在这】(确定不来看看?)

ssm + ftp +ueditor

MySQL重做日志 redo log

WPF command directive and inotifypropertychanged

深度学习系列46:人脸图像超分GFP-GAN

C language learning summary
随机推荐
深度学习系列46:人脸图像超分GFP-GAN
[project training] details of linear components
MySQL重做日志 redo log
301. 删除无效的括号
Common setup modes (Abstract Factory & responsibility chain mode & observer mode)
Verilog syntax explanation
898. 子数组按位或操作
cmder
【STL】容器适配器之stack、queue用法总结
407 stack and queue (232. implementing queue with stack, 225. implementing stack with queue)
Xxl-sso enables SSO single sign on
Vs2013 ffmpeg environment configuration and common error handling
Children's programming for comprehensively cultivating students' mental thinking
技术文章写作指南
WPF command directive and inotifypropertychanged
asp. Net file download demo and related problems
关于五险一金你需要知道的事情
Anti chicken soup speech
Linux Installation mysql8.0.25
313. 超级丑数