当前位置:网站首页>PSP code implementation
PSP code implementation
2022-06-23 07:11:00 【Houston pineapple】
principle :
Backbone+PSP+Prediction
Realization :
# Code reference official
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()
effect
边栏推荐
猜你喜欢

深度学习系列47:超分模型Real-ESRGAN

正则表达式图文超详细总结不用死记硬背(上篇)

406 double pointer (27. remove elements, 977. square of ordered array, 15. sum of three numbers, 18. sum of four numbers)

产品-Axure9(英文版),原型设计后台动态二级菜单显示内容

【日常训练】513. 找树左下角的值

deeplab v3 代码结构图

【STL】顺序容器之deque用法总结

TP6+Redis+think-queue+Supervisor实现进程常驻消息队列/job任务

MySQL重做日志 redo log

产品-Axure9(英文版),原型设计 制作下拉二级菜单
随机推荐
Analyzing the creation principle in maker Education
897. 递增顺序搜索树
Page embedded iframe click browser back problem
309. 最佳买卖股票时机含冷冻期
产品-Axure9(英文版),原型设计后台动态二级菜单显示内容
技术文章写作指南
322. 零钱兑换
301. delete invalid brackets
Using fuser to view file usage
深度学习系列46:人脸图像超分GFP-GAN
[system] right click the desktop icon. After turning around, the Explorer will crash and the desktop will be refreshed
C DPI adaptation problem
如何达到高效的网络信息传播
XML DTD record
Analysis of personalized learning progress in maker Education
316. 去除重复字母
【STL】pair用法总结
901. stock price span
406-双指针(27. 移除元素、977.有序数组的平方、15. 三数之和、18. 四数之和)
【STL】关联容器之unordered_map用法总结