-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·49 lines (34 loc) · 828 Bytes
/
generate.sh
File metadata and controls
executable file
·49 lines (34 loc) · 828 Bytes
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
# Generates compressed images
# Usage ./gen.sh file alg start stop step overflow log
# See ./__main__ usage for more details
FILE=$1
alg=$2
mode=$3
curr=$4
stop=$(($5 + 1))
step=$6
protectOverflow=$7
log=$8
name=${FILE%%.*}
ext=${FILE##*.}
directory=${name}\_${alg}\_${mode}\_${protectOverflow}
endl=$'\n'
mkdir -p ./output/$directory
echo "GENERATING IMAGES:${endl}"
while [ $curr -lt $stop ]
do
echo "Running iteration: Value = ${curr}"
output=${name}\_${curr}.$ext
path=${directory}/${output}
if [[ !( -f "output/${path}") ]]
then
echo ${endl}
./__main__.py $FILE $alg $mode $curr $protectOverflow $log $path
echo "${endl}Done.${endl}${endl}${endl}"
else
echo "${output} already exists, skipping iteration...${endl}"
fi
curr=$(($curr + $step))
done
echo "SCRIPT COMPLETED"