Skip to content

Instantly share code, notes, and snippets.

@arturojain
Last active March 9, 2019 05:06
Show Gist options
  • Save arturojain/5e43c17bbf1f11308333b64da5e01d84 to your computer and use it in GitHub Desktop.
Save arturojain/5e43c17bbf1f11308333b64da5e01d84 to your computer and use it in GitHub Desktop.
Script to preprocess images to 224 by 224 pixels for ML
# Example usage:
# ./pre-processing.sh <path-to-dir-with-jpg-images>
#!/bin/bash
output=$1"/"
res="224:224"
for j in $(ls -C1 "$output")
do
ffmpeg -i "$output"/"$j" -vf scale=$res "$output"/"$res"_"$j"
rm "$output"/"$j"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment