diff --git a/README.md b/README.md index 1e7687f1767e23bbf60535eecd5c215c39a97dcc..59dc84da4c6d6a5a6ac24d8b7dbaa0d338075b5e 100644 --- a/README.md +++ b/README.md @@ -74,4 +74,12 @@ The difference between this repo and gdrn conference version mainly including: `./core/gdrn_modeling/test_gdrn.sh <config_path> <gpu_ids> <ckpt_path> (other args)` ## Pose Refinement -TODO: rudy \ No newline at end of file +We utilize depth information to further refine the estimated pose. +We provide two types of refinement: fast refinement and iterative refinement. + +For fast refinement, we compare the rendered object depth and the observed depth to refine translation. +Run + +`./core/gdrn_modeling/test_gdrn_depth_refine.sh <config_path> <gpu_ids> <ckpt_path> (other args)` + +For iterative refinement, please checkout to the pose_refine branch for details. diff --git a/core/gdrn_modeling/test_gdrn_depth_refine.sh b/core/gdrn_modeling/test_gdrn_depth_refine.sh new file mode 100644 index 0000000000000000000000000000000000000000..e242c6b4c4c49fd4bc1062d010d0eda6abb21ca0 --- /dev/null +++ b/core/gdrn_modeling/test_gdrn_depth_refine.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# test +set -x +this_dir=$(dirname "$0") +# commonly used opts: + +# MODEL.WEIGHTS: resume or pretrained, or test checkpoint +CFG=$1 +CUDA_VISIBLE_DEVICES=$2 +IFS=',' read -ra GPUS <<< "$CUDA_VISIBLE_DEVICES" +# GPUS=($(echo "$CUDA_VISIBLE_DEVICES" | tr ',' '\n')) +NGPU=${#GPUS[@]} # echo "${GPUS[0]}" +echo "use gpu ids: $CUDA_VISIBLE_DEVICES num gpus: $NGPU" +CKPT=$3 +if [ ! -f "$CKPT" ]; then + echo "$CKPT does not exist." + exit 1 +fi +NCCL_DEBUG=INFO +OMP_NUM_THREADS=1 +MKL_NUM_THREADS=1 +PYTHONPATH="$this_dir/../..":$PYTHONPATH \ +CUDA_VISIBLE_DEVICES=$2 python $this_dir/main_gdrn.py \ + --config-file $CFG --num-gpus $NGPU --eval-only \ + --opts MODEL.WEIGHTS=$CKPT INPUT.WITH_DEPTH=True TEST.USE_DEPTH_REFINE=True \ + ${@:4}