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
相关推荐
晚夜微雨问海棠呀26 分钟前
长沙景区数据分析项目实现
开发语言·python·信息可视化
cdut_suye36 分钟前
Linux工具使用指南:从apt管理、gcc编译到makefile构建与gdb调试
java·linux·运维·服务器·c++·人工智能·python
dundunmm1 小时前
机器学习之scikit-learn(简称 sklearn)
python·算法·机器学习·scikit-learn·sklearn·分类算法
古希腊掌管学习的神1 小时前
[机器学习]sklearn入门指南(1)
人工智能·python·算法·机器学习·sklearn
一道微光1 小时前
Mac的M2芯片运行lightgbm报错,其他python包可用,x86_x64架构运行
开发语言·python·macos
四口鲸鱼爱吃盐2 小时前
Pytorch | 利用AI-FGTM针对CIFAR10上的ResNet分类器进行对抗攻击
人工智能·pytorch·python
是娜个二叉树!2 小时前
图像处理基础 | 格式转换.rgb转.jpg 灰度图 python
开发语言·python
互联网杂货铺2 小时前
Postman接口测试:全局变量/接口关联/加密/解密
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·postman
南七澄江3 小时前
各种网站(学习资源及其他)
开发语言·网络·python·深度学习·学习·机器学习·ai