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
相关推荐
会员源码网9 分钟前
Python中生成器函数与普通函数的区别
python
Java水解34 分钟前
Python开发从入门到精通:Web框架Django实战
后端·python
曲幽2 小时前
FastAPI + PostgreSQL 实战:给应用装上“缓存”和“日志”翅膀
redis·python·elasticsearch·postgresql·logging·fastapi·web·es·fastapi-cache
Lupino5 小时前
别再只聊 AI 写代码了:技术负责人要把“变更治理”提到第一优先级
python·docker·容器
Flittly6 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(6)Context Compact (上下文压缩)
python·agent
曲幽17 小时前
FastAPI + PostgreSQL 实战:从入门到不踩坑,一次讲透
python·sql·postgresql·fastapi·web·postgres·db·asyncpg
用户8356290780511 天前
使用 C# 在 Excel 中创建数据透视表
后端·python
码路飞1 天前
FastMCP 实战:一个 .py 文件,给 Claude Code 装上 3 个超实用工具
python·ai编程·mcp
dev派1 天前
AI Agent 系统中的常用 Workflow 模式(2) Evaluator-Optimizer模式
python·langchain
前端付豪1 天前
AI 数学辅导老师项目构想和初始化
前端·后端·python