Skip to content

Commit 058d084

Browse files
author
Aleksei Silvestrov
committed
gen masks and celeba_example
1 parent 758a946 commit 058d084

File tree

4 files changed

+49
-5
lines changed

4 files changed

+49
-5
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,19 @@ On the host machine:
199199
# unzip & split into train/test/visualization & create config for it
200200
bash fetch_data/celebahq_dataset_prepare.sh
201201
202-
203-
TODO: trian
204-
TODO: eval
202+
# generate masks for test and viz at the end of epoch
203+
bash fetch_data/celebahq_gen_masks.sh
204+
205+
# Run training
206+
# You can change bs with data.batch_size=10
207+
python bin/train.py -cn lama-fourier-celeba location=celeba
208+
209+
# Infer model on thick/thin/medium masks in 256 and run evaluation
210+
# like this:
211+
python3 bin/predict.py \
212+
model.path=$(pwd)/experiments/<user>_<date:time>_lama-fourier-celeba_/ \
213+
indir=$(pwd)/celeba-hq-dataset/visual_test_256/random_thick_256/ \
214+
outdir=$(pwd)/inference/celeba_random_thick_256 model.checkpoint=last.ckpt
205215
206216
207217
Docker: TODO
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @package _group_
2+
data_root_dir: /home/user/lama/celeba-hq-dataset/
3+
out_root_dir: /home/user/lama/experiments/
4+
tb_dir: /home/user/lama/tb_logs/
5+
pretrained_models: /home/user/lama/

fetch_data/celebahq_dataset_prepare.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ for mode in train \
2222
val \
2323
visual_test
2424
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/"
25+
mkdir celeba-hq-dataset/$mode"_source_256/"
26+
cat celeba-hq-dataset/$mode"_shuffled.flist" | xargs -I {} mv celeba-hq-dataset/data256x256/{} celeba-hq-dataset/$mode"_source_256/"
2727
done
2828

2929

fetch_data/celebahq_gen_masks.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
python3 bin/gen_mask_dataset.py \
2+
$(pwd)/configs/data_gen/random_thick_256.yaml \
3+
celeba-hq-dataset/val_source_256/ \
4+
celeba-hq-dataset/val_256/random_thick_256/
5+
6+
python3 bin/gen_mask_dataset.py \
7+
$(pwd)/configs/data_gen/random_thin_256.yaml \
8+
celeba-hq-dataset/val_source_256/ \
9+
celeba-hq-dataset/val_256/random_thin_256/
10+
11+
python3 bin/gen_mask_dataset.py \
12+
$(pwd)/configs/data_gen/random_medium_256.yaml \
13+
celeba-hq-dataset/val_source_256/ \
14+
celeba-hq-dataset/val_256/random_medium_256/
15+
16+
python3 bin/gen_mask_dataset.py \
17+
$(pwd)/configs/data_gen/random_thick_256.yaml \
18+
celeba-hq-dataset/visual_test_source_256/ \
19+
celeba-hq-dataset/visual_test_256/random_thick_256/
20+
21+
python3 bin/gen_mask_dataset.py \
22+
$(pwd)/configs/data_gen/random_thin_256.yaml \
23+
celeba-hq-dataset/visual_test_source_256/ \
24+
celeba-hq-dataset/visual_test_256/random_thin_256/
25+
26+
python3 bin/gen_mask_dataset.py \
27+
$(pwd)/configs/data_gen/random_medium_256.yaml \
28+
celeba-hq-dataset/visual_test_source_256/ \
29+
celeba-hq-dataset/visual_test_256/random_medium_256/

0 commit comments

Comments
 (0)