forked from ayushchopra96/viton-gan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·46 lines (37 loc) · 1.19 KB
/
demo.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1.19 KB
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
40
41
42
43
44
45
46
#!/bin/bash
set -e
if [ "$#" -ne 2 ]; then
echo "ERROR: run_smartfit.sh requires two inputs: relative path to the person image and relative path to the clothing image."
exit
fi
# Set variables
person_img=$PWD"/"$1
clothing_img=$PWD"/"$2
# Clean directories
rm -f human_parsing/output/*
rm -f pose_estimation/output/*
rm -f try-on/VITON/data/segment/*
rm -f try-on/VITON/data/pose.pkl
rm -f try-on/VITON/data/pose/*
rm -f try-on/VITON/data/women_top/*
rm -rf try-on/VITON/results/*
rm -f output/output.png
# Run human parsing
printf "\nRunning human parsing...\n\n"
cd human_parsing/
./run_human_parsing.py $person_img
# Run pose estimation
printf "\nRunning pose estimation...\n\n"
cd ../pose_estimation/
python run_pose_estimation.py $person_img --output ../output/
# Move output to target directories in try-on/
cd ../
cp human_parsing/output/*.mat try-on/VITON/data/segment/
cp pose_estimation/output/pose.pkl try-on/VITON/data/
cp pose_estimation/output/*.mat try-on/VITON/data/pose/
# Run try-on
printf "\nRunning image try-on...\n\n"
cd try-on/
./run_try-on.sh $person_img $clothing_img
# Copy output to main output directory
cp VITON/results/stage2/images/*final.png ../output/output.png