-
Notifications
You must be signed in to change notification settings - Fork 39
/
extract_dpm_parts.sh
executable file
·31 lines (21 loc) · 1.31 KB
/
extract_dpm_parts.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
FFLD_DIR=./ffld_dpm #contains 'ffld' executable
for train_or_test in 'train' 'test'
do
dpd_scratch='/media/big_disk/dpd_scratch'
in_img_dir=${dpd_scratch}/bird_images_for_ffld/$train_or_test
in_bbox_dir=${dpd_scratch}/bird_labels_for_ffld/$train_or_test
out_parts_dir=${dpd_scratch}/cropped_bird_imgs_ffld/$train_or_test
show_parts_dir=${dpd_scratch}/show_bird_parts_ffld/$train_or_test #temporary -- parts annotated on input imgs
for curr_img in $in_img_dir/*
do
#note: --images = output dir for 'images with parts drawn on them'
# --out_parts_dir = output dir for 'parts cropped out of the input images'
echo $curr_img
filename=$(basename "$curr_img") #thanks: stackoverflow.com/questions/965053
in_bbox_fname=$in_bbox_dir/"${filename%.*}".txt #e.g. 00003.txt
echo $in_bbox_fname
#extract parts using DPM
time $FFLD_DIR/build/ffld --out-parts-dir $out_parts_dir --in-bbox-fname $in_bbox_fname --model $FFLD_DIR/models/dpm_bird_weak.txt --results ./result.txt --images $show_parts_dir --threshold=-2.5 $curr_img
#echo ./ffld --out-parts-dir $out_parts_dir --in-bbox-fname $in_bbox_fname --model ../models/dpm_bird_weak.txt --results ./result.txt --images $show_parts_dir --threshold=-0.5 $curr_img #for gdb
done
done