Skip to content
Snippets Groups Projects
Commit 58b361e0 authored by jwangzzz's avatar jwangzzz
Browse files

fix the download script

parent a083c20a
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ This repository is the implementation code of the paper "DenseFusion: 6D Object ...@@ -26,7 +26,7 @@ This repository is the implementation code of the paper "DenseFusion: 6D Object
## Requirements ## Requirements
* Python 2.7/3.5/3.6 (No strict requirements for the Python version. Small changes of some print functions might be enough to switch between different versions.) * Python 2.7/3.5/3.6 (If you want use Python2.7 to run this repo, please rebuild the `lib/knn/` (with PyTorch 0.4.1).)
* [PyTorch 0.4.1](https://pytorch.org/) * [PyTorch 0.4.1](https://pytorch.org/)
* PIL * PIL
* scipy * scipy
......
# Download the datasets and checkpoints # Download the datasets and checkpoints
if [ ! -d datasets/ycb/YCB_Video_Dataset ];then
echo 'Downloading the YCB-Video Dataset' echo 'Downloading the YCB-Video Dataset'
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1if4VoEXNx9W3XCn0Y7Fp15B4GpcYbyYi' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1if4VoEXNx9W3XCn0Y7Fp15B4GpcYbyYi" -O YCB_Video_Dataset.zip && rm -rf /tmp/cookies.txt \
&& unzip YCB_Video_Dataset.zip \
&& mv YCB_Video_Dataset/ datasets/ycb/ \
&& rm YCB_Video_Dataset.zip
fi
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1if4VoEXNx9W3XCn0Y7Fp15B4GpcYbyYi' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1if4VoEXNx9W3XCn0Y7Fp15B4GpcYbyYi" -O YCB_Video_Dataset.zip && rm -rf /tmp/cookies.txt if [ ! -d datasets/linemod/Linemod_preprocessed ];then
unzip YCB_Video_Dataset.zip
mv YCB_Video_Dataset/ datasets/ycb/
rm YCB_Video_Dataset.zip
echo 'Downloading the preprocessed LineMOD dataset' echo 'Downloading the preprocessed LineMOD dataset'
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1YFUra533pxS_IHsb9tB87lLoxbcHYXt8' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1YFUra533pxS_IHsb9tB87lLoxbcHYXt8" -O Linemod_preprocessed.zip && rm -rf /tmp/cookies.txt \
&& unzip Linemod_preprocessed.zip \
&& mv Linemod_preprocessed/ datasets/linemod/ \
&& rm Linemod_preprocessed.zip
fi
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1YFUra533pxS_IHsb9tB87lLoxbcHYXt8' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1YFUra533pxS_IHsb9tB87lLoxbcHYXt8" -O Linemod_preprocessed.zip && rm -rf /tmp/cookies.txt if [ ! -d trained_checkpoints ];then
unzip Linemod_preprocessed.zip
mv Linemod_preprocessed/ datasets/linemod/
rm Linemod_preprocessed.zip
echo 'Downloading the trained checkpoints...' echo 'Downloading the trained checkpoints...'
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1bQ9H-fyZplQoNt1qRwdIUX5_3_1pj6US' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1bQ9H-fyZplQoNt1qRwdIUX5_3_1pj6US" -O trained_checkpoints.zip && rm -rf /tmp/cookies.txt \
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1bQ9H-fyZplQoNt1qRwdIUX5_3_1pj6US' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1bQ9H-fyZplQoNt1qRwdIUX5_3_1pj6US" -O trained_checkpoints.zip && rm -rf /tmp/cookies.txt && unzip trained_checkpoints.zip -x "__MACOSX/*" "*.DS_Store" "*.gitignore" -d trained_checkpoints \
unzip trained_checkpoints.zip && mv trained_checkpoints/trained*/ycb trained_checkpoints/ycb \
echo 'Copying trained checkpoints to trained_models/' && mv trained_checkpoints/trained*/linemod trained_checkpoints/linemod \
cp trained_checkpoints/ycb/*.pth trained_models/ycb/ && rm -r trained_checkpoints/trained*/ \
cp trained_checkpoints/linemod/*.pth trained_models/linemod/ && rm trained_checkpoints.zip
rm trained_checkpoints.zip fi
rm -r trained_checkpoints/
echo 'done' echo 'done'
\ No newline at end of file
...@@ -6,6 +6,6 @@ set -e ...@@ -6,6 +6,6 @@ set -e
export PYTHONUNBUFFERED="True" export PYTHONUNBUFFERED="True"
export CUDA_VISIBLE_DEVICES=0 export CUDA_VISIBLE_DEVICES=0
python ./tools/eval_linemod.py --dataset_root ./datasets/linemod/Linemod_preprocessed\ python3 ./tools/eval_linemod.py --dataset_root ./datasets/linemod/Linemod_preprocessed\
--model pose_model_9_0.01310166542980859.pth\ --model trained_checkpoints/linemod/pose_model_9_0.01310166542980859.pth\
--refine_model pose_refine_model_493_0.006761023565178073.pth --refine_model trained_checkpoints/linemod/pose_refine_model_493_0.006761023565178073.pth
\ No newline at end of file \ No newline at end of file
...@@ -15,6 +15,6 @@ if [ ! -d YCB_Video_toolbox ];then ...@@ -15,6 +15,6 @@ if [ ! -d YCB_Video_toolbox ];then
cp replace_ycb_toolbox/*.m YCB_Video_toolbox/ cp replace_ycb_toolbox/*.m YCB_Video_toolbox/
fi fi
python ./tools/eval_ycb.py --dataset_root ./datasets/ycb/YCB_Video_Dataset\ python3 ./tools/eval_ycb.py --dataset_root ./datasets/ycb/YCB_Video_Dataset\
--model pose_model_26_0.012863246640872631.pth\ --model trained_checkpoints/ycb/pose_model_26_0.012863246640872631.pth\
--refine_model pose_refine_model_69_0.009449292959118935.pth --refine_model trained_checkpoints/ycb/pose_refine_model_69_0.009449292959118935.pth
\ No newline at end of file \ No newline at end of file
...@@ -6,5 +6,5 @@ set -e ...@@ -6,5 +6,5 @@ set -e
export PYTHONUNBUFFERED="True" export PYTHONUNBUFFERED="True"
export CUDA_VISIBLE_DEVICES=0 export CUDA_VISIBLE_DEVICES=0
python ./tools/train.py --dataset linemod\ python3 ./tools/train.py --dataset linemod\
--dataset_root ./datasets/linemod/Linemod_preprocessed --dataset_root ./datasets/linemod/Linemod_preprocessed
\ No newline at end of file
...@@ -6,5 +6,5 @@ set -e ...@@ -6,5 +6,5 @@ set -e
export PYTHONUNBUFFERED="True" export PYTHONUNBUFFERED="True"
export CUDA_VISIBLE_DEVICES=0 export CUDA_VISIBLE_DEVICES=0
python ./tools/train.py --dataset ycb\ python3 ./tools/train.py --dataset ycb\
--dataset_root ./datasets/ycb/YCB_Video_Dataset --dataset_root ./datasets/ycb/YCB_Video_Dataset
\ No newline at end of file
...@@ -30,7 +30,6 @@ objlist = [1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15] ...@@ -30,7 +30,6 @@ objlist = [1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15]
num_points = 500 num_points = 500
iteration = 2 iteration = 2
dataset_config_dir = 'datasets/linemod/dataset_config' dataset_config_dir = 'datasets/linemod/dataset_config'
trained_models_dir = 'trained_models/linemod'
output_result_dir = 'experiments/eval_result/linemod' output_result_dir = 'experiments/eval_result/linemod'
...@@ -38,8 +37,8 @@ estimator = PoseNet(num_points = num_points, num_obj = num_objects) ...@@ -38,8 +37,8 @@ estimator = PoseNet(num_points = num_points, num_obj = num_objects)
estimator.cuda() estimator.cuda()
refiner = PoseRefineNet(num_points = num_points, num_obj = num_objects) refiner = PoseRefineNet(num_points = num_points, num_obj = num_objects)
refiner.cuda() refiner.cuda()
estimator.load_state_dict(torch.load('{0}/{1}'.format(trained_models_dir, opt.model))) estimator.load_state_dict(torch.load(opt.model))
refiner.load_state_dict(torch.load('{0}/{1}'.format(trained_models_dir, opt.refine_model))) refiner.load_state_dict(torch.load(opt.refine_model))
estimator.eval() estimator.eval()
refiner.eval() refiner.eval()
......
...@@ -50,7 +50,6 @@ dataset_config_dir = 'datasets/ycb/dataset_config' ...@@ -50,7 +50,6 @@ dataset_config_dir = 'datasets/ycb/dataset_config'
ycb_toolbox_dir = 'YCB_Video_toolbox' ycb_toolbox_dir = 'YCB_Video_toolbox'
result_wo_refine_dir = 'experiments/eval_result/ycb/Densefusion_wo_refine_result' result_wo_refine_dir = 'experiments/eval_result/ycb/Densefusion_wo_refine_result'
result_refine_dir = 'experiments/eval_result/ycb/Densefusion_iterative_result' result_refine_dir = 'experiments/eval_result/ycb/Densefusion_iterative_result'
trained_models_dir = 'trained_models/ycb'
def get_bbox(posecnn_rois): def get_bbox(posecnn_rois):
rmin = int(posecnn_rois[idx][3]) + 1 rmin = int(posecnn_rois[idx][3]) + 1
...@@ -92,12 +91,12 @@ def get_bbox(posecnn_rois): ...@@ -92,12 +91,12 @@ def get_bbox(posecnn_rois):
estimator = PoseNet(num_points = num_points, num_obj = num_obj) estimator = PoseNet(num_points = num_points, num_obj = num_obj)
estimator.cuda() estimator.cuda()
estimator.load_state_dict(torch.load('{0}/{1}'.format(trained_models_dir, opt.model))) estimator.load_state_dict(torch.load(opt.model))
estimator.eval() estimator.eval()
refiner = PoseRefineNet(num_points = num_points, num_obj = num_obj) refiner = PoseRefineNet(num_points = num_points, num_obj = num_obj)
refiner.cuda() refiner.cuda()
refiner.load_state_dict(torch.load('{0}/{1}'.format(trained_models_dir, opt.refine_model))) refiner.load_state_dict(torch.load(opt.refine_model))
refiner.eval() refiner.eval()
testlist = [] testlist = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment