当前位置:网站首页>PyTorch 使用 MaxPool 实现图像的膨胀和腐蚀
PyTorch 使用 MaxPool 实现图像的膨胀和腐蚀
2022-07-28 05:17:00 【一知半解百晓生】
max_pool = nn.MaxPool2d(kernel_size=5, stride=1, padding=2) # 可调整 kernel_size 和 padding
# 假设要处理的张量为 tensor
# ===== 膨胀 =====
tensor_dilate = max_pool(tensor)
# ===== 腐蚀 =====
tensor_erode = -max_pool(-tensor)
边栏推荐
- How does Alibaba use DDD to split microservices?
- JUC笔记
- List<Long>,List<Integer>互相转换
- 数据库面试
- 导出excel,生成多个sheet页,并命名
- 分享几种管理C程序中标志位的方法
- Long和Integer如何进行比较,为什么报错
- docker 部署 mysql5.7.35
- 2022 summer practice (PowerDesigner tutorial learning record) (first week)
- Scanf function of input and output function in C language
猜你喜欢

多线程进阶:synchronized底层原理,锁优化、锁升级的过程

11.< tag-动态规划和子序列, 子数组>lt.115. 不同的子序列 + lt. 583. 两个字符串的删除操作 dbc

Scanf function of input and output function in C language

自定义Json返回数据

Google browser cannot open localhost:3000. If you open localhost, you will jump to the test address

Scope, execution process and life cycle of bean

PC side bug record

Mysql基本查询

VMware Workstation 与 Device/Credential Guard 不兼容。禁用 Device/Credential Guard

ByteBuffer.position 抛出异常 IllegalArgumentException
随机推荐
The solution after the samesite by default cookies of Chrome browser 91 version are removed, and the solution that cross domain post requests in chrome cannot carry cookies
CentOS7安装MySQL5.7
regular expression
Thinking on multi system architecture design
架构设计思考之一(SSO设计)
New arrow function in ES6
正则表达式
C language: realize the simple function of address book through structure
lamda 获取当前循环数,AtomicInteger
注册中心服务eureka 切换到 nocas遇到的问题
24小时内的时间段无交叉
Antd setfieldsvalue warning problem cannot use 'setfieldsvalue' until you use 'getfielddecorator' or
JMeter related knowledge sorting
Making RPM packages with nfpm
Edge calculation kubeedge+edgemash
Oracle用sql查询某张表的字段信息(字段类型、长度等)
Duoyu security browser will improve the security mode and make users browse more safely
MySQL adds sequence number to query results
接口幂等性问题
导出excel,生成多个sheet页,并命名