Skip to content

Instantly share code, notes, and snippets.

@BernardoGO
Created June 15, 2016 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BernardoGO/d18531ef025902d1c0405e6813302846 to your computer and use it in GitHub Desktop.
Save BernardoGO/d18531ef025902d1c0405e6813302846 to your computer and use it in GitHub Desktop.
build test set from training sets
for D in $(find train/ -mindepth 1 -maxdepth 1 -type d) ; do
b=$(basename $D)
echo $D $b;
for Di in $(find $D/ -mindepth 1 -maxdepth 1 -type f | head -n 3) ; do
bi=$(basename $Di)
echo file: $Di $bi;
mkdir test/$b
mv $Di test/$b/$bi
done
done
for D in $(find train/ -mindepth 1 -maxdepth 1 -type d | head -n 8) ; do
b=$(basename $D)
echo $D $b;
mkdir tiny_train
for Di in $(find $D/ -mindepth 1 -maxdepth 1 -type f | head -n 50) ; do
bi=$(basename $Di)
echo file: $Di $bi;
mkdir tiny_train/$b
cp $Di tiny_train/$b/$bi
done
done
for D in $(find test/ -mindepth 1 -maxdepth 1 -type d | head -n 8) ; do
b=$(basename $D)
echo $D $b;
mkdir tiny_test
for Di in $(find $D/ -mindepth 1 -maxdepth 1 -type f | head -n 50) ; do
bi=$(basename $Di)
echo file: $Di $bi;
mkdir tiny_test/$b
cp $Di tiny_test/$b/$bi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment