split_convertall.sh 1 KB
Newer Older
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
#!/bin/bash

#
#    Script - convert tif to png
#
#    Name: script_convertall.sh
#    Author: Gabriel Kirsten Menezes (gabriel.kirsten@hotmail.com)
#

echo "[SCRIPT CONVERT ALL] Initializing..."

dir_train="../../data/demo_split/train"
dir_validation="../../data/demo_split/validation"

echo "[SCRIPT CONVERT ALL] Converting train..."

for dir_class in `ls $dir_train`;
do
    echo "[SCRIPT CONVERT ALL] Converting class -" $dir_class;
    convert $dir_train/$dir_class/* $dir_train/$dir_class/$dir_class.png
    echo "[SCRIPT CONVERT ALL] Removing all .tif files in $dir_class ..."
    rm $dir_train/$dir_class/*.tif
done

echo "[SCRIPT CONVERT ALL] Converting validation..."

for dir_class in `ls $dir_validation`;
do
    echo "[SCRIPT CONVERT ALL] Converting class -" $dir_class;
    convert $dir_validation/$dir_class/* $dir_validation/$dir_class/$dir_class.png
    echo "[SCRIPT CONVERT ALL] Removing all .tif files in $dir_class ..."
    rm $dir_validation/$dir_class/*.tif
done

echo "[SCRIPT CONVERT ALL] OK! DONE."