| set -ex | |
| MODE=$1 | |
| DATASET=${2:-mixkit} | |
| echo "Running in mode: $MODE" | |
| if [ "$MODE" == "sample_all" ]; then | |
| conda run --no-capture-output -n torch python sample.py --root_dir mixkit --size 512 | |
| rm -rf mixkit | |
| conda run --no-capture-output -n torch python sample.py --root_dir pexels --size 512 | |
| rm -rf pexels | |
| conda run --no-capture-output -n torch python sample.py --root_dir pixabay --size 512 | |
| rm -rf pixabay | |
| elif [ "$MODE" == "sample" ]; then | |
| if [ "$DATASET" == "mixkit" ]; then | |
| unpigz -c mixkit.tar.gz | tar -xvf - | |
| elif [ "$DATASET" == "pexels" ]; then | |
| cat pexels.tar.gz.0* | unpigz -c - | tar -xvf - | |
| elif [ "$DATASET" == "pixabay" ]; then | |
| cat pixabay.tar.gz.{00..24} | unpigz -c - | tar -xvf - | |
| fi | |
| rm -rf $DATASET.tar.gz* | |
| conda run --no-capture-output -n torch python sample.py --root_dir $DATASET --size 512 | |
| rm -rf $DATASET | |
| elif [ "$MODE" == "sample_files"]; then | |
| conda run --no-capture-output -n torch python sample.py --root_dir mixkit --size 512 --output_format files | |
| rm -rf mixkit | |
| conda run --no-capture-output -n torch python sample.py --root_dir pexels --size 512 --output_format files | |
| rm -rf pexels | |
| conda run --no-capture-output -n torch python sample.py --root_dir pixabay --size 512 --output_format files | |
| rm -rf pixabay | |
| else | |
| echo "Invalid mode" | |
| fi | |