-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunner.sh
More file actions
44 lines (36 loc) · 1.39 KB
/
runner.sh
File metadata and controls
44 lines (36 loc) · 1.39 KB
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
#!/bin/bash
conda init
conda activate super
declare sets=("train" "val" "test")
declare sizes=(15 50)
declare algos=("SLIC")
img_root="/home/hsenior/coco/img"
out_root="/home/hsenior/coco/superpixel_features"
model_id="BLIP"
for set in "${sets[@]}"
do
# Generate whole image features
python3 main.py --image_dir ${img_root}/${set}2014/ \
--save_dir ${out_root}/${model_id}/whole_img \
--feature_extractor ${model_id} \
--whole_img
python3 merge_and_clean.py --save_dir ${out_root}/${model_id}/whole_img \
--output_dir ${out_root}/${model_id}/whole_img \
for algo in "${algos[@]}"
do
for size in "${sizes[@]}"
do
echo "Processing $set with $size superpixels using $algo"
# Generate superpixel features
python3 main.py --image_dir ${img_root}/${set}2014/ \
--save_dir ${out_root}/${model_id}/${algo}/${set}_m${size} \
--num_superpixels ${size} \
--algorithm ${algo} \
--feature_extractor ${model_id} \
--rag
python3 merge_and_clean.py --save_dir ${out_root}/${model_id}/${algo}/${set}_m${size} \
--output_dir ${out_root}/${model_id}/${algo}/m${size} \
--delete
done
done
done