-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmvpose.sh
executable file
·64 lines (55 loc) · 1.34 KB
/
mvpose.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
echo ""
echo ""
echo "execute mvpose on $1"
echo ""
echo ""
VID_DIR="$1/videos"
CAM_DIR="$1/cameras"
POSE_DIR="$1/poses"
OPENPOSE_DIR="$PWD/openpose"
if [ ! -d "$VID_DIR" ]; then
echo "video directory $VID_DIR does not exist!"
exit 1
fi
N_CAMS=$(ls -l $VID_DIR | grep -c ^d)
echo "#cameras: $N_CAMS"
if [ ! -d "$POSE_DIR" ]; then
mkdir $POSE_DIR
echo "execute 2D pose estimation..."
for ((CID=0; CID<$N_CAMS; CID++))
do
echo -e "\t 2D pose estimation for camera $CID"
CAMERA=$(printf "camera%02d" $CID)
POSE2D_INPUT="$VID_DIR/$CAMERA"
POSE2D_OUTPUT="$POSE_DIR/$CAMERA"
mkdir $POSE2D_OUTPUT
cd $OPENPOSE_DIR && ./openpose.sh $POSE2D_INPUT $POSE2D_OUTPUT
done
else
echo "2D poses already estimated"
fi
DOCKER_VERSION=$(docker version --format '{{.Server.Version}}')
echo "docker: $DOCKER_VERSION"
if [[ $DOCKER_VERSION == 19* ]]; then
docker run\
--gpus all\
--privileged\
--name='mv3dpose_exec'\
--rm\
-it\
-v "$PWD":/home/user/mv3dpose:ro\
-v "$1":/home/user/dataset\
jutanke/mv3dpose\
/bin/bash exec.sh
else
nvidia-docker run\
--privileged\
--name='mv3dpose_exec'\
--rm\
-it\
-v "$PWD":/home/user/mv3dpose:ro\
-v "$1":/home/user/dataset\
jutanke/mv3dpose\
/bin/bash exec.sh
fi