BAAM: Monocular 3D pose and shape reconstruction with bi-contextual attention module and attention-guided modeling
This repo is the official Code of BAAM: Monocular 3D pose and shape reconstruction with bi-contextual attention module and attention-guided modeling (CVPR 2023).
We recommend you to use an Anaconda virtual environment with Python 3.9.
- Install pytorch 1.10.1, Detectron2, and Pytorch3D
#pytorch
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
# detectron2
python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
# pytorch3d
pip install "git+https://github.com/facebookresearch/pytorch3d.git"
- Install Requirements
pip install -r requirement.txt
- Set data referring here.
First install pre-trained weights and place it in root [CODE] path. Then run the command below.
python main.py
- To faster convergence, we use the pre-trainned COCO 2017 weights. You can downlod it from hear.
- Replace the third line of
configs/custom.yaml
-best_rel_model.pth
toCenterNet2_R2-101-DCN-BiFPN_4x+4x_1560_ST.pth
. - Run the command below.
python main.py -t
- Finish either inference process or train process.
- move to
evaluation
folder. - Run the comman below.
python eval.py --light --test_dir ../outputs/res --gt_dir ../data/apollo/val/apollo_annot --res_file test_results.txt
- You can show A3DP results in
test_results.txt
.