- Ubuntu 20.04
- Python 3.9
- Pytorch 2.3.0
- CUDA 11.8
- 1 * NVIDIA RTX 4090
conda env create -f environment.yaml
conda activate BioDetcd Instance_Segmentation_Model
python download_sam.py
python download_fastsam.py
python download_dinov2.pyThe organization of the checkpoints should be as follows:
SAM-6D
└── Instance_Segmentation_Model
├── checkpoints
├── dinov2
├── FastSAM
├── gdino
├── HVI
├── mobilesam
└── segment-anything-
You can download the Datasets (IPD/XYZ-IBD) from BOP Benchmark.
-
We provide the rendered templates of IPD for trying, you can download from this link
-
The organization of the datasets should be as follows:
SAM-6D
└── Data
├── BOP
├── ipd
├── test
├── models
├── test_targets_bop24.json
├── xyzibd
├── test
├── models
├── test_targets_bop24.json
└── BOP-Templates
├── ipd
├── xyzibd
# Feel free to change the data path under "SAM-6D/Instance_Segmentation_Model/preprocess/config.yaml"# inference IPD with fastsam
python SAM-6D/Instance_Segmentation_Model/inference_ipd.py \
--dataset_name ipd \
--cfg SAM-6D/Instance_Segmentation_Model/preprocess/config.yaml \
--sam_type ISM_fastsam
# inference IPD with sam
python SAM-6D/Instance_Segmentation_Model/inference_ipd.py \
--dataset_name ipd \
--cfg SAM-6D/Instance_Segmentation_Model/preprocess/config.yaml \
--sam_type ISM_sam
# inference XYZ-IBD with fastsam
python SAM-6D/Instance_Segmentation_Model/inference_xyzibd.py \
--dataset_name ipd \
--cfg SAM-6D/Instance_Segmentation_Model/preprocess/config.yaml \
--sam_type ISM_fastsam
# inference XYZ-IBD with sam
python SAM-6D/Instance_Segmentation_Model/inference_xyzibd.py \
--dataset_name ipd \
--cfg SAM-6D/Instance_Segmentation_Model/preprocess/config.yaml \
--sam_type ISM_sampython convert_bop_fromat.py --dataset_name ipd --segmentation_model fastsam
python convert_bop_fromat.py --dataset_name ipd --segmentation_model sam
python convert_bop_fromat.py --dataset_name xyzibd --segmentation_model fastsam
python convert_bop_fromat.py --dataset_name xyzibd --segmentation_model samThe code is adapted from SAM6D.