Learning to Segment Rigid Motions from Two Frames 代码复现

环境配置

https://github.com/gengshan-y/rigidmask

1.拉取代码

bash 复制代码
git clone https://github.com/gengshan-y/rigidmask.git
cd rigidmask

2.创建conda环境,修改rigidmask.yml

bash 复制代码
name: rigidmask
channels:
  - pytorch
  - pytorch3d
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - numba
  - tqdm
  - tbb
  - joblib
  - h5py
  - pytorch=1.7.0
  - torchvision=0.8.0
  - cudatoolkit=11.0
  - pip:
    - absl-py==0.11.0
    - cachetools==4.1.1
    - chardet==3.0.4
    - cloudpickle==1.6.0
    - cython==0.29.21
    - dataclasses==0.6
#    - dcnv2==0.1
    - future==0.18.2
    - fvcore==0.1.2.post20201122
    - google-auth==1.23.0
    - google-auth-oauthlib==0.4.2
    - grpcio==1.34.0
    - idna==2.10
    - joblib==0.17.0
#    - kornia==0.4.2+74cc0cf
    - markdown==3.3.3
#    - ngransac==0.0.0
    - oauthlib==3.1.0
  # - opencv-python==4.4.0.46
    - portalocker==2.0.0
    - protobuf==3.14.0
    - pyasn1==0.4.8
    - pyasn1-modules==0.2.8
#    - pycocotools==2.0.2
    - pydot==1.4.1
    - pypng==0.0.20
    - pyyaml==5.3.1
    - requests==2.25.0
    - requests-oauthlib==1.3.0
    - rsa==4.6
    - tabulate==0.8.7
    - tensorboard==2.4.0
    - tensorboard-plugin-wit==1.7.0
    - termcolor==1.1.0
    - tqdm==4.54.0
    - urllib3==1.26.2
    - werkzeug==1.0.1
    - yacs==0.1.8
    - imageio==2.9.0
    - trimesh==3.9.3
bash 复制代码
conda env create -f rigidmask.yml
conda activate rigidmask
bash 复制代码
pip install scipy==1.2.0
pip install timm==0.6.5
pip install pytorch3d-0.2.5
pip install opencv-python==3.4.9.33
pip install opencv-contrib-python==3.4.9.33
bash 复制代码
conda install -c conda-forge kornia=0.5.3 # install a compatible korna version
python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu110/torch1.7/index.html
bash 复制代码
# sudo apt-get install libopencv-dev
conda install libopencv

DCNv2和ngransac

bash 复制代码
cd models/networks/DCNv2/; python setup.py install; cd -
cd models/ngransac/; python setup.py install; cd -

测试

1.下载数据集和模型

KITTI-SF: https://s3.eu-central-1.amazonaws.com/avg-kitti/data_scene_flow.zip

Sintel rigidity map : http://files.is.tue.mpg.de/jwulff/mrflow/sintel_rigiditymaps.zip

bash 复制代码
gdown https://drive.google.com/uc?id=1Up2cPCjzd_HGafw1AB2ijGmiKqaX5KTi -O ./input.tar.gz
gdown https://drive.google.com/uc?id=12C7rl5xS66NpmvtTfikr_2HWL5SakLVY -O ./rigidmask-sf-precomputed.zip
tar -xzvf ./input.tar.gz 
unzip ./rigidmask-sf-precomputed.zip -d precomputed/

2.测试一下

bash 复制代码
# modelname=rigidmask-sf
# CUDA_VISIBLE_DEVICES=1 
# python submission.py --dataset seq-coral --datapath input/imgs/coral/   --outdir ./weights/$modelname/ --loadmodel ./weights/$modelname/weights.pth --testres 1
# python eval/generate_visual.py --datapath weights/$modelname/seq-coral/ --imgpath input/imgs/coral


modelname=rigidmask-sf
CUDA_VISIBLE_DEVICES=1 
python submission.py --dataset seq-kitti --datapath input/imgs/kitti_2011_09_30_drive_0028_sync_11xx/   --outdir ./weights/$modelname/ --loadmodel ./weights/$modelname/weights.pth --testres 1.2 --refine
python eval/generate_visual.py --datapath weights/$modelname/seq-kitti/ --imgpath input/imgs/kitti_2011_09_30_drive_0028_sync_11xx
# python eval/render_scene.py --inpath weights/rigidmask-sf/seq-kitti/pc0-0000001110.ply
相关推荐
失去妙妙屋的米奇3 分钟前
Python与图像处理
图像处理·python·计算机视觉
yuanpan30 分钟前
如何将python项目打包成Windows环境的exe应用提供给客户使用
开发语言·windows·python
程序员一诺31 分钟前
【爬虫开发】爬虫开发从0到1全知识教程第14篇:scrapy爬虫框架,介绍【附代码文档】
后端·爬虫·python·数据
njsgcs41 分钟前
python getattr调用当前文件引用的模块内的方法,实例
开发语言·python
独好紫罗兰1 小时前
洛谷题单3-P2669 [NOIP 2015 普及组] 金币-python-流程图重构
开发语言·python·算法
跳跳糖炒酸奶1 小时前
第四章、Isaacsim在GUI中构建机器人(3):添加摄像头和传感器
人工智能·python·算法·ubuntu·机器人
凯强同学1 小时前
第十四届蓝桥杯大赛软件赛省赛Python 研究生组:4.互质数的个数
python·职场和发展·蓝桥杯
utmhikari3 小时前
【日常随笔】万字长文,如何用pyside6开发一个python桌面工具
前端·python·pyqt
小杨4045 小时前
python入门系列十四(多进程)
人工智能·python·pycharm
用户277844910499320 小时前
借助DeepSeek智能生成测试用例:从提示词到Excel表格的全流程实践
人工智能·python