-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathresize-script.sh
executable file
·38 lines (33 loc) · 1.01 KB
/
resize-script.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
#!/bin/bash
#simple script for resizing images in all class directories
#also reformats everything from whatever to png
if [ `ls test-images/*/*.jpg 2> /dev/null | wc -l ` -gt 0 ]; then
echo hi
for file in test-images/*/*.jpg; do
convert "$file" -resize 28x28\! "${file%.*}.png"
file "$file" #uncomment for testing
rm "$file"
done
fi
if [ `ls test-images/*/*.png 2> /dev/null | wc -l ` -gt 0 ]; then
echo hi
for file in test-images/*/*.png; do
convert "$file" -resize 28x28\! "${file%.*}.png"
file "$file" #uncomment for testing
done
fi
if [ `ls training-images/*/*.jpg 2> /dev/null | wc -l ` -gt 0 ]; then
echo hi
for file in training-images/*/*.jpg; do
convert "$file" -resize 28x28\! "${file%.*}.png"
file "$file" #uncomment for testing
rm "$file"
done
fi
if [ `ls training-images/*/*.png 2> /dev/null | wc -l ` -gt 0 ]; then
echo hi
for file in training-images/*/*.png; do
convert "$file" -resize 28x28\! "${file%.*}.png"
file "$file" #uncomment for testing
done
fi