Skip to content

Instantly share code, notes, and snippets.

@jihyeonRyu
Created June 7, 2017 09:49
Show Gist options
  • Save jihyeonRyu/89d5eb3c5f9c17532a10ca10a3cf0346 to your computer and use it in GitHub Desktop.
Save jihyeonRyu/89d5eb3c5f9c17532a10ca10a3cf0346 to your computer and use it in GitHub Desktop.
extract file randomly
#!/bin/bash
# test data set을 추출하기 위함
MAXCOUNT=100
count=1
RANGE=983
DIR='/d/Source/Repos/iconRecognition2/iconRecognitionWithTF/icon_image'
while [ $count -le $MAXCOUNT ] # 100개 뽑을 때까지 반복
do
echo "conunt: " $count
rannum=$RANDOM
let "rannum %= $RANGE"
echo "random num: " $rannum
echo $DIR/train/$1/[A-Za-z]*[^0-9]$rannum.png
mv $DIR/train/$1/[A-Za-z]*[^0-9]$rannum.png $DIR/eval/$1
let "count += 1"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment