【代码复现】UNOPose: Unseen Object Pose Estimation with an Unposed RGB-D Reference Image
安装UNOPose环境
修改
requirements.txt
文件:- 第59行:注释
torch==2.2.0+cu118
; - 第61行:注释
torchvision==0.17.0+cu118
。
- 第59行:注释
创建环境:
1
conda create --name unopose python=3.10.12
激活环境:
1
conda activate unopose
安装依赖:
1
2
3
4
5
6pip3 install torch==2.0.0 torchvision==0.15.0 --index-url https://download.pytorch.org/whl/cu117
pip3 install mmcv==2.2.0 -f https://download.openmmlab.com/mmcv/dist/cu117/torch2.0/index.html
pip3 install -r requirements.txt
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'安装bop_toolkit:
1
2cd third_party/bop_toolkit
python setup.py install安装pointnet2:
1
2cd core/unopose/model/pointnet2/
pip3 install -e .
数据集下载
在代码对应的Hugging Face🤗数据集仓库中下载数据集配对文件:
- https://huggingface.co/datasets/shanice-l/UNOPose_data/resolve/main/CustomSamAutomaticMaskGeneratorOnerefTargetsCrosssceneRot50Refvisib_ycbv-test.json
- https://huggingface.co/datasets/shanice-l/UNOPose_data/resolve/main/CustomSamAutomaticMaskGenerator_test_oneref_targets_crossscene_rot50_refvisib_ycbv.json
- https://huggingface.co/datasets/shanice-l/UNOPose_data/resolve/main/megapose_gso_fixed_obj_id_to_visib0_8_scene_im_inst_ids.json
- https://huggingface.co/datasets/shanice-l/UNOPose_data/resolve/main/megapose_gso_fixed_valid_inst_ids.json
- https://huggingface.co/datasets/shanice-l/UNOPose_data/resolve/main/megapose_shapenetcore_fixed_obj_id_to_visib0_8_scene_im_inst_ids.json
- https://huggingface.co/datasets/shanice-l/UNOPose_data/resolve/main/megapose_shapenetcore_fixed_valid_inst_ids.json
- https://huggingface.co/datasets/shanice-l/UNOPose_data/resolve/main/test_ref_targets_crossscene_rot50.json
下载YCB-V数据集的部份数据:
- https://huggingface.co/datasets/bop-benchmark/ycbv/resolve/main/ycbv_test_all.zip
- https://huggingface.co/datasets/bop-benchmark/ycbv/resolve/main/ycbv_models.zip
- https://huggingface.co/datasets/bop-benchmark/ycbv/resolve/main/ycbv_base.zip
下载预训练模型
执行:
1 | python core/unopose/scripts/download_and_save_dinov2_ckpt.py |
下载的预训练模型如下:
1 | $ ls checkpoints/ |
运行代码
解压ycbv_test_all.zip
,并将上述下载的7个配对文件组织如下:
1 | datasets |
执行:
1 | ./core/unopose/save_unopose.sh configs/main_cfg.py <gpu_ids> checkpoints/timm_vit_base_patch14_reg4_dinov2_lvd142m.pth |