-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreconstruct_faces.sh
More file actions
39 lines (31 loc) · 954 Bytes
/
reconstruct_faces.sh
File metadata and controls
39 lines (31 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
NUM_THREADS=4 # How many GPUs do you have?
PY_SCRIPT=algorithms/reconstruct_faces.py
declare -a TASKS=(
"lfw retinaface arcface"
"lfw mtcnn facenet"
"agedb_30 retinaface arcface"
"agedb_30 mtcnn facenet"
"cfp_fp retinaface arcface"
"cfp_fp mtcnn facenet"
)
for TASK in "${TASKS[@]}"; do
IFS=' ' read -r dataset aligner model <<< "$TASK"
echo "🧪 Starting reconstruction: $dataset / $aligner / $model"
JSON_PATH="runs/preprocessed_data/${dataset}_${aligner}/samples.json"
OUTNAME="${dataset}_${aligner}_${model}"
for i in $(seq 0 $((NUM_THREADS-1))); do
echo " → Launching shard $i on GPU $i"
CUDA_VISIBLE_DEVICES=$i python $PY_SCRIPT \
--json "$JSON_PATH" \
--model "$model" \
--gpu "0" \
--threads $NUM_THREADS \
--index $i \
--outname "$OUTNAME" &
done
wait
echo "Finished: $dataset / $aligner / $model"
done
echo "All reconstructions completed."