DSFNet(Dynamic and Static Fusion Network for Moving Object Detection in Satellite Videos)代码调试
帮人解决的论文代码,分享以下经验,小的安装问题就不叙述了,分析主要问题:
问题一:DCNv2的配置
运行之前还需配置好DCN,在./lib/model/DCNv2/下面因为DSFNET.py等都需要DCN网络
代码自带的DCNv2总是无法setup,报错cuda和gcc编译器问题,太麻烦,应此另辟蹊径,不使用代码自带的DCNv2,使用mmcv中的DCN实现。
首先下载安装mmcv库:
# 命令行输入:
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
# 将其中的{cu_version}替换为你的CUDA版本,{torch_version}替换为你已经安装的pytorch版本;
# 例如:CUDA 为11.0,pytorch为1.7.0
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
刚开始一直安装不上,后面发现是信任问题,因此改为如下,将安装网站用trusted-host转换
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu116/torch1.13.0/index.html --trusted-host download.openmmlab.com
在代码中替换
from mmcv.ops import DeformConv2dPack as DCN
# 使用方法与官方DCNv2一样,只不过deformable_groups参数名改为deform_groups即可,例如:
dconv2 = DCN(in_channel, out_channel, kernel_size=(3, 3), stride=(2, 2), padding=1, deform_groups=2)
在原论文代码中就是将DSFNET.py、DSFNET_with_Dynamic.py、DSFNET_with_Static.py中DCN的引用做替换:
# from lib.models.DCNv2.dcn_v2 import DCN
from mmcv.ops import DeformConv2dPack as DCN
问题二:原代码的get_pose_net函数未定义
在DSFNET.py、DSFNET_with_Dynamic.py、DSFNET_with_Static.py中都提到了get_pose_net,但代码中并未定义,这其实是伪函数,需要自己定义网络如下:
在DSFNET.py中
if __name__ == '__main__':# net = get_pose_net({'hm': 1, 'wh': 2, 'reg': 2}, 256)net = DSFNet({'hm': 1, 'wh': 2, 'reg': 2}, 256)total = sum([param.nelement() for param in net.parameters()])print(' Number of params: %.2fM' % (total / 1e6))
在DSFNET_with_Dynamic.py中
if __name__ == '__main__':# net = get_pose_net({'hm': 1, 'wh': 2, 'reg': 2}, 256)net = DSFNet_with_Dynamic({'hm': 1, 'wh': 2, 'reg': 2}, 256)total = sum([param.nelement() for param in net.parameters()])print(' Number of params: %.2fM' % (total / 1e6))
在DSFNET_with_Static.py中
if __name__ == '__main__':# net = get_pose_net({'hm': 1, 'wh': 2, 'reg': 2}, 256)net = DSFNet_with_Static({'hm': 1, 'wh': 2, 'reg': 2}, 256)total = sum([param.nelement() for param in net.parameters()])print(' Number of params: %.2fM' % (total / 1e6))
问题三:pycocotools安装问题
pip install pycocotools是不行的,需使用git
pip install git+https://gitee.com/pursuit_zhangyu/cocoapi.git#subdirectory=PythonAPI
如果requirements.txt中的cython、scipy等都没安装就会报错,需安装完后安装pycocotools
问题四:其他杂项
还是说一下其他杂项吧
1、在/Moving-object-detection-DSFNet-main/lib/utils/opts.py中有很多初始化定义,比如权重文件的保存位置,显卡调用数量等,需根据自身情况调整
2、数据需要保存在/Moving-object-detection-DSFNet-main/data/中,自己建立
3、其他小问题我记不住了,欢迎提问!
DSFNet(Dynamic and Static Fusion Network for Moving Object Detection in Satellite Videos)代码调试相关推荐
- 无人驾驶中的目标检测--MODNet: Moving Object Detection Network for Autonomous Driving
MODNet: Moving Object Detection Network with Motion and Appearance for Autonomous Driving 这里讲视频动作识别中 ...
- 【论文阅读】Moving Object Detection: Review of Recent Research Trends
Moving Object Detection 已提出的方法 Background Subtraction Frame differencing Temporal Differencing Optic ...
- 目标检测--A Unified Multi-scale Deep Convolutional Neural Network for Fast Object Detection
A Unified Multi-scale Deep Convolutional Neural Network for Fast Object Detection ECCV2016 https://g ...
- ECCV 2020预会议 直播笔记| Suppress and Balance: A Simple Gated Network for Salient Object Detection
目标跟踪基础与智能前沿 寻找 目标跟踪方向的小伙伴,如果你苦于没有地方可以和同方向的小伙伴交流,我们创建了一个交流群,点上方链接可以进入,每周的交流活动通过该号宣传,群里随时随地可以展开讨论,无论是学 ...
- 【译】A Fully Spiking Hybrid Neural Network for Energy-Efficient Object Detection
文章目录 [译]A Fully Spiking Hybrid Neural Network for Energy-Efficient Object Detection 1 Abstract 2 Int ...
- EGNet: Edge Guidance Network for Salient Object Detection 论文及代码解读
EGNet: Edge Guidance Network for Salient Object Detection 论文及代码解读 注:本文原创作者为Jia-Xing Zhao, Jiang-Jian ...
- 自动驾驶论文:FisheyeMODNet: Moving Object detection on Surround-view Cameras for Autonomous Driving (2019)
FisheyeMODNet: Moving Object detection on Surround-view Cameras for Autonomous Driving 论文链接: https:/ ...
- Extended Feature Pyramid Network for Small Object Detection
Extended Feature Pyramid Network for Small Object Detection 论文链接:https://arxiv.org/abs/2003.07021v1 ...
- 【论文笔记】Multi-Content Complementation Network for Salient Object Detection in Optical RSI
论文 论文:Multi-Content Complementation Network for Salient Object Detection in Optical Remote Sensing I ...
最新文章
- 资源 | 一文掌握机器学习所有值得看的视频、课程、工具
- 2017-2018-2 20179216 《网络攻防与实践》 第四周总结
- 深信服:输入一个字符串,帮忙统计字符串里面的每个单词出现的次数,以及非法单词的次数。非法单词的定义为:包含数字(0-9)的单词
- NYOJ 179 LK's problem
- 力扣:15三数之和(python)
- 并不对劲的loj2179:p3714:[BJOI2017]树的难题
- js 数组过滤_JS之 开发技巧
- 【数据结构与算法】字符串匹配 KMP 算法
- WPF中如何重新定义Main函数
- 【Java从0到架构师】SpringBoot - 入门_配置文件_YAML
- springcloud-config-client的那些坑
- python项目方案书-前端python解释器方案预研
- 灵格斯与众多常用软件的冲突问题
- java 校验银行卡号_Java之——基于Luhn算法的银行卡卡号的格式校验
- Python Selenium 疑难杂症解方(二): 定位
- git加速 用谷歌浏览器插件
- 高通msm8996启动流程
- 计算机优质书籍搜集(持续更新)
- java 微信 jssdk 分享朋友圈_JSSDK微信自定义分享朋友圈
- 微信QQ域名防封防红防屏蔽系统源码