Skip to content

Commit 62375ae

Browse files
author
Aleksei Silvestrov
committed
celeba unzip & shuffle & split
1 parent 559e234 commit 62375ae

File tree

3 files changed

+30040
-0
lines changed

3 files changed

+30040
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
mkdir celeba-hq-dataset
2+
3+
unzip data256x256.zip -d celeba-hq-dataset/
4+
5+
# Reindex
6+
for i in `echo {00001..30000}`
7+
do
8+
mv 'celeba-hq-dataset/data256x256/'$i'.jpg' 'celeba-hq-dataset/data256x256/'$[10#$i - 1]'.jpg'
9+
done
10+
11+
12+
# train/test/vis split
13+
cat fetch_data/train_shuffled.flist | shuf > celeba-hq-dataset/temp_train_shuffled.flist
14+
cat celeba-hq-dataset/temp_train_shuffled.flist | head -n 2000 > celeba-hq-dataset/val_shuffled.flist
15+
cat celeba-hq-dataset/temp_train_shuffled.flist | tail -n +2001 > celeba-hq-dataset/train_shuffled.flist
16+
17+
cat fetch_data/val_shuffled.flist > celeba-hq-dataset/visual_test_shuffled.flist
18+
19+
20+
# Split
21+
for mode in train \
22+
val \
23+
visual_test
24+
do
25+
mkdir celeba-hq-dataset/$mode"_256"
26+
cat celeba-hq-dataset/$mode"_shuffled.flist" | xargs -I {} mv celeba-hq-dataset/data256x256/{} celeba-hq-dataset/$mode"_256/"
27+
done
28+
29+
30+
# create location config celeba.yaml
31+
PWD=$(pwd)
32+
DATASET=${PWD}/celeba-hq-dataset
33+
CELEBA=${PWD}/configs/training/location/celeba.yaml
34+
35+
touch $CELEBA
36+
echo "# @package _group_" >> $CELEBA
37+
echo "data_root_dir: ${DATASET}/" >> $CELEBA
38+
echo "out_root_dir: ${PWD}/experiments/" >> $CELEBA
39+
echo "tb_dir: ${PWD}/tb_logs/" >> $CELEBA
40+
echo "pretrained_models: ${PWD}/" >> $CELEBA

0 commit comments

Comments
 (0)