forked from RockStarCoders/alienMarkovNetworks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunOnPaulsResults.sh
executable file
·48 lines (42 loc) · 1.12 KB
/
runOnPaulsResults.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
#!/bin/bash
K="$1"; shift
typeset -i nbThreads="$1"; shift
inputDir="$1"; shift
probsBase="$1"; shift
odirBase="$1"; shift
K0="$1"; shift
# e.g.
#
# ./runOnPaulsResults.sh 5.0 8 \
# /data/adss/Trials/Aerial/ISPRS_WGIII_benchmark_2014/Labeled/top \
# /data/adss/users/sherrahj/isprs/paulsResults/2014-12-22/baseline_res \
# /data/adss/users/sherrahj/isprs/ourResults/mrf/pixel
#export K="10.0"
odir="$odirBase/K_${K}"
mkdir -p "$odir"
typeset -i cnt=0
if [ -z "$K0" ]; then
kzero=$( echo "$K*0.025" | bc -l )
else
kzero="$K0"
fi
while read ifn; do
echo "*** JOB $cnt"
#for file in /data/adss/Trials/Aerial/ISPRS_WGIII_benchmark_2014/Labeled/top/top_mosaic_09cm_area*.tif; do
file="$inputDir/$ifn"
num=${file#*area}
num=${num%.tif}
echo $file: $num
#echo ./sceneLabelN.py \
ofile="$odir"/$(basename "$file")
ofile="${ofile%.tif}.png"
time ./sceneLabelN.py \
--matFn "$probsBase"_area${num}.mat \
"$file" --outfile "$ofile" \
--K $K --nhoodSz 8 --K0 $kzero &
cnt=$(($cnt+1))
if [ $cnt == $nbThreads ]; then
wait
cnt=0
fi
done < ~/code/isprs/trainingImages.txt