Demo entry 5862521

aaa

   

Submitted by ggg on Aug 09, 2016 at 09:57
Language: C. Code size: 582 Bytes.

CURRENT_DIR=/home/vision/deming/proj-disu/image
IMG_DIR=train
LIST_DIR=list_trainval
for dir in `ls $CURRENT_DIR/$IMG_DIR`
do
	for img in `ls $CURRENT_DIR/$IMG_DIR/$dir`
	do
		echo $CURRENT_DIR/$IMG_DIR/$dir/$img ${dir/*./} >> $LIST_DIR/$dir.txt
	done
done

for list in `ls $LIST_DIR`
do
	shuf $LIST_DIR/$list -o $LIST_DIR/$list.shuflist
done

for shuflist in `ls $LIST_DIR/*.shuflist`
do
	head -n 1000 $shuflist >> disu_train.txt
	tail -n +1001 $shuflist >> disu_val.txt
done

shuf disu_train.txt -o disu_train.shuf.txt
shuf disu_val.txt -o disu_val.shuf.txt

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).