当前位置:网站首页>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()
效果
边栏推荐
- How to migrate virtual machines from VirtualBox to hype-v
- Why does TCP protocol shake hands three times instead of two?
- Configuration and compilation of mingw-w64, msys and ffmpeg
- [project training 10] drawing of arrows
- QT designer cannot modify the window size, and cannot change the size by dragging the window with the mouse
- Eureka
- 反鸡汤致辞
- 产品-Axure9(英文版),原型设计后台动态二级菜单显示内容
- [project training] details of linear components
- 深度学习系列46:人脸图像超分GFP-GAN
猜你喜欢

Swagger3 integrates oauth2 authentication token

Badly placed()'s problem

MySQL重做日志 redo log

Common setup modes (Abstract Factory & responsibility chain mode & observer mode)

Vs2013 ffmpeg environment configuration and common error handling
![[system] right click the desktop icon. After turning around, the Explorer will crash and the desktop will be refreshed](/img/aa/0189beb065fa0d4b625390793cb79b.png)
[system] right click the desktop icon. After turning around, the Explorer will crash and the desktop will be refreshed

MySQL basic query

MySQL mvcc multi version concurrency control

【STL】关联容器之unordered_map用法总结

图解三次握手四次挥手,小白都能看懂
随机推荐
A small method of debugging equipment serial port information with ADB
图解三次握手四次挥手,小白都能看懂
反鸡汤致辞
309. 最佳买卖股票时机含冷冻期
MySQL basic query
XML schema record
Storage mode of data in memory (C language)
Verilog syntax explanation
312. 戳气球
896. 单调数列
ssm + ftp +ueditor
【毕业季·进击的技术er】自己的选择,跪着也要走
【Qt】基础学习笔记
[bull Chinese document] queue package used to process distributed jobs and messages in nodejs
Add IPAD control function into shairplay
redux Actions may not have an undefined “type“ property. Have you misspelled a constant?
20220621 Three Conjugates of Dual Quaternions
English grammar_ Adverb - ever / once
直播回顾 | 传统应用进行容器化改造,如何既快又稳?
MySQL Redo log Redo log