File size: 2,315 Bytes
b24c748 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | # Pose Estimation Model (PEM) for SAM-6D

## Requirements
The code has been tested with
- python 3.9.6
- pytorch 2.0.0
- CUDA 11.3
Other dependencies:
```
sh dependencies.sh
```
## Data Preparation
Please refer to [[link](https://github.com/JiehongLin/SAM-6D/tree/main/SAM-6D/Data)] for more details.
## Model Download
Our trained model is provided [[here](https://drive.google.com/file/d/1joW9IvwsaRJYxoUmGo68dBVg-HcFNyI7/view?usp=sharing)], and could be downloaded via the command:
```
python download_sam6d-pem.py
```
## Training on MegaPose Training Set
To train the Pose Estimation Model of SAM-6D, please prepare the training data and run the folowing command:
```
python train.py --gpus 0,1,2,3 --model pose_estimation_model --config config/base.yaml
```
By default, we use four GPUs of 3090ti to train the model with batchsize set as 28.
## Evaluation on BOP Datasets
To evaluate the model on BOP datasets, please run the following command:
```
python test_bop.py --gpus 0 --model pose_estimation_model --config config/base.yaml --dataset $DATASET --view 42
```
The string "DATASET" could be set as `lmo`, `icbin`, `itodd`, `hb`, `tless`, `tudl`, `ycbv`, or `all`. Before evaluation, please refer to [[link](https://github.com/JiehongLin/SAM-6D/tree/main/SAM-6D/Data)] for rendering the object templates of BOP datasets, or download our [rendered templates](https://drive.google.com/drive/folders/1fXt5Z6YDPZTJICZcywBUhu5rWnPvYAPI?usp=drive_link). Besides, the instance segmentation should be done following [[link](https://github.com/JiehongLin/SAM-6D/tree/main/SAM-6D/Instance_Segmentation_Model)]; to test on your own segmentation results, you could change the "detection_paths" in the `test_bop.py` file.
One could also download our trained model for evaluation:
```
python test_bop.py --gpus 0 --model pose_estimation_model --config config/base.yaml --checkpoint_path checkpoints/sam-6d-pem-base.pth --dataset $DATASET --view 42
```
## Acknowledgements
- [MegaPose](https://github.com/megapose6d/megapose6d)
- [GDRNPP](https://github.com/shanice-l/gdrnpp_bop2022)
- [GeoTransformer](https://github.com/qinzheng93/GeoTransformer)
- [Flatten Transformer](https://github.com/LeapLabTHU/FLatten-Transformer)
|