-
Notifications
You must be signed in to change notification settings - Fork 40
/
run_market_test.sh
executable file
·99 lines (88 loc) · 3.6 KB
/
run_market_test.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
source ~/.bashrc
if [ ! -d ./data/Market_train_data ]; then
cd data
wget homes.esat.kuleuven.be/~liqianma/NIPS17_PG2/data/Market_train_data.zip
unzip Market_train_data.zip
mv data4tf_GAN_attr_pose_onlyPosPair_128x64PoseRCV_Mask_sparse_Attr_partBbox7_maskR4R6 Market_train_data
rm -f Market_train_data.zip
cd ..
fi
if [ ! -d ./data/Market_trainAStest_data ]; then
cd data
mkdir Market_trainAStest_data
cd Market_trainAStest_data
ln -s ../Market_train_data/* .
for file in *train* ; do mv "$file" "${file/train/test}" ; done
cd ../..
fi
if [ ! -d ./data/Market_test_data ]; then
cd data
wget homes.esat.kuleuven.be/~liqianma/NIPS17_PG2/data/Market_test_data.zip
unzip Market_test_data.zip
mv data4tf_GAN_attr_pose_onlyPosPair_128x64PoseRCV_Mask_test_sparse_Attr_partBbox7_maskR4R6 Market_test_data
rm -f Market_test_data.zip
cd ..
fi
gpu=0
D_arch='DCGAN'
log_dir=your_log_dir_path
log_dir_pretrain=your_pretrained_log_dir_path
stage=1
####################### Testing Whole Framework #####################
model_dir=${log_dir}'/MODEL4_subnetSamplePoseRCV_WGAN'
## Appearance
pretrained_path=${log_dir_pretrain}'/MODEL1_Encoder_GAN_BodyROI7_PartVis_FgBg/model.ckpt-0'
pretrained_appSample_path=${log_dir_pretrain}'/MODEL3_subSampleAppNetFgBg_WGAN/model.ckpt-0'
## Pose
pretrained_poseAE_path=${log_dir_pretrain}'/MODEL2_PoseRCV_AE/model.ckpt-0'
pretrained_poseSample_path=${log_dir_pretrain}'/MODEL4_subnetSamplePoseRCV_WGAN/model.ckpt-0'
## Generate data for re-id
python main.py --dataset=Market_trainAStest_data \
--use_gpu=True --input_scale_size=128 \
--batch_size=32 \
--is_train=False \
--sample_app=True \
--sample_pose=False \
--one_app_per_batch=True \
--model=11 \
--D_arch=${D_arch} \
--gpu=${gpu} \
--z_num=64 \
--model_dir=${model_dir} \
--pretrained_path=${pretrained_path} \
--pretrained_appSample_path=${pretrained_appSample_path} \
--pretrained_poseAE_path=${pretrained_poseAE_path} \
--pretrained_poseSample_path=${pretrained_poseSample_path} \
## Generate data for Sampling one or more factors
python main.py --dataset=Market_trainAStest_data \
--use_gpu=True --input_scale_size=128 \
--batch_size=32 \
--is_train=False \
--sample_fg=True \
--sample_bg=True \
--sample_pose=True \
--model=13 \
--D_arch=${D_arch} \
--gpu=${gpu} \
--z_num=64 \
--model_dir=${model_dir} \
--pretrained_path=${pretrained_path} \
--pretrained_appSample_path=${pretrained_appSample_path} \
--pretrained_poseAE_path=${pretrained_poseAE_path} \
--pretrained_poseSample_path=${pretrained_poseSample_path} \
## PG2 task (Conditional pose guided person image generation)
python main.py --dataset=Market_test_data \
--use_gpu=True --input_scale_size=128 \
--batch_size=32 \
--is_train=False \
--model=12 \
--D_arch=${D_arch} \
--gpu=${gpu} \
--z_num=64 \
--model_dir=${model_dir} \
--pretrained_path=${pretrained_path} \
--pretrained_poseAE_path=${pretrained_poseAE_path} \
--pretrained_poseSample_path=${pretrained_poseSample_path} \
test_dir=your_test_dir_name
python score.py ${stage} ${gpu} ${model_dir} ${test_dir}
python score_mask.py ${stage} ${gpu} ${model_dir} ${test_dir}