Vision Transformers for Dense Prediction——代码实践

相关申明

源代码地址

@article{Ranftl2021,
	author    = {Ren\'{e} Ranftl and Alexey Bochkovskiy and Vladlen Koltun},
	title     = {Vision Transformers for Dense Prediction},
	journal   = {ArXiv preprint},
	year      = {2021},
}
@article{Ranftl2020,
	author    = {Ren\'{e} Ranftl and Katrin Lasinger and David Hafner and Konrad Schindler and Vladlen Koltun},
	title     = {Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer},
	journal   = {IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI)},
	year      = {2020},
}

 小赵在ubuntu18.04系统下进行论文的代码实践,简单流程如下:

1.下载github项目到本地

git clone https://github.com/isl-org/DPT.git

2.根据提示,下载model weights——Monodepth & Segmentation,并将下载的.pt文件放置到DPT项目的weights文件夹内

3. 通过anaconda3创建相关环境

conda create -n DPT python=3.7
source activate DPT
cd DPT
conda install --yes --file requirements.txt
或
pip3 install -r requirements.txt

Python 3.7, PyTorch 1.8.0, OpenCV 4.5.1, and timm 0.4.5 均通过requirements.txt完成安装

4.运行

  • 将image(单张或多张)放置
  • 执行单目深度估计模型
python run_monodepth.py
  • 执行语义分割模型
python run_segmentation.py

 5.结果

结果分别放置在对应的output_monodepth 和 output_semseg 

6.拓展 

将Monodepth微调后作用在KITTI,下载对应.pt文件,放置到weights

将Monodepth微调后作用在NYUv2,下载对应.pt文件,放置到weights 

执行

python run_monodepth -t [dpt_hybrid_kitti|dpt_hybrid_nyu] 

python run_monodepth.pt -t dpt_hybrid_kitti

python run_monodepth.pt -t dpt_hybrid_nyu

kitti

nyu

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
回答: 本文提出了一种名为EfficientFormerV2的高效网络,旨在重新思考Vision Transformers以实现与MobileNet相当的模型大小和速度。作者结合了细粒度联合搜索策略,通过一系列的设计和优化,使EfficientFormerV2在相同参数量和延迟下比MobileNetV2在ImageNet验证集上的性能高出4个百分点。\[1\]该网络的设计考虑了资源受限型硬件的需求,特别关注模型的参数量和延迟,以适应端侧部署的场景。\[2\]如果您对EfficientFormerV2感兴趣,可以通过扫描二维码或添加微信号CVer222来获取论文和代码,并申请加入CVer-Transformer微信交流群。此外,CVer学术交流群也提供了其他垂直方向的讨论,包括目标检测、图像分割、目标跟踪、人脸检测和识别等多个领域。\[3\] #### 引用[.reference_title] - *1* *3* [更快更强!EfficientFormerV2来了!一种新的轻量级视觉Transformer](https://blog.csdn.net/amusi1994/article/details/128379490)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [EfficientFormerV2: Transformer家族中的MobileNet](https://blog.csdn.net/CVHub/article/details/129739986)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MengYa_DreamZ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值