From d181e66e3bdc4507760caa6634e228c8d7a1f628 Mon Sep 17 00:00:00 2001 From: Guillaume Rochette <g.rochette@surrey.ac.uk> Date: Mon, 10 Feb 2020 17:31:58 +0000 Subject: [PATCH] Updated files with permissions, etc... --- OFFLINE.sh | 26 -------------------------- ONLINE.sh | 26 -------------------------- VIZ.sh | 27 --------------------------- offline.sh | 33 +++++++++++++++++++++++++++++++++ online.sh | 22 ++++++++++++++++++++++ viz.sh | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 88 insertions(+), 79 deletions(-) delete mode 100644 OFFLINE.sh delete mode 100644 ONLINE.sh delete mode 100644 VIZ.sh create mode 100755 offline.sh create mode 100755 online.sh create mode 100755 viz.sh diff --git a/OFFLINE.sh b/OFFLINE.sh deleted file mode 100644 index d7a6b6d..0000000 --- a/OFFLINE.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash -video=$(realpath $1) -video_dir=$(dirname $video) -video_name=$(basename $video) - -output_tar=$2 -output_dir=$(dirname $output_tar) -mkdir -p $output_dir -output_dir=$(realpath $output_dir) -output_name=$(basename $output_tar) -tmp_dir=$(basename $output_tar | cut -d. -f1) - -docker run \ - --gpus all \ - --mount type=bind,source=$video_dir,target=/input \ - --mount type=bind,source=$output_dir,target=/output \ - registry.eps.surrey.ac.uk/openpose:15668 /bin/bash -c \ - "mkdir -p $tmp_dir && \ - ./build/examples/openpose/openpose.bin --video /input/$video_name --write_json $tmp_dir \ - --number_people_max 1 \ - --scale_number 4 --scale_gap 0.25 \ - --hand --hand_scale_number 6 --hand_scale_range 0.4 \ - --display 0 --render_pose 0 && \ - tar -czf /output/$output_name $tmp_dir" - -# chmod a=rwx $output_tar diff --git a/ONLINE.sh b/ONLINE.sh deleted file mode 100644 index 2a50637..0000000 --- a/ONLINE.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash - -xhost local:root - -output_tar=$1 -output_dir=$(dirname $output_tar) -mkdir -p $output_dir -output_dir=$(realpath $output_dir) -output_name=$(basename $output_tar) -tmp_dir=$(basename $output_tar | cut -d. -f1) - -# Run /bin/bash within the Docker image registry.eps.surrey.ac.uk/openpose:6965, with the first line of options for the GUI output, the second for the Webcam, the third for the GPUs and the fourth to write on the disk while in the container. (-it stands for interactive) - -sudo docker run \ - --gpus all \ - --env="DISPLAY" --net=host --mount type=bind,source=$HOME/.Xauthority,target=/root/.Xauthority:rw \ - --device=/dev/video0:/dev/video0 \ - --mount type=bind,source=$output_dir,target=/output \ - registry.eps.surrey.ac.uk/openpose:15668 /bin/bash -c \ - "mkdir -p $tmp_dir && \ - ./build/examples/openpose/openpose.bin --video /input/$video_name --write_json $tmp_dir \ - --number_people_max 1 \ - --hand && \ - tar -czf /output/$output_name $tmp_dir" - -# chmod a=rwx $output_tar diff --git a/VIZ.sh b/VIZ.sh deleted file mode 100644 index 2df7838..0000000 --- a/VIZ.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -xhost local:root - -video=$(realpath $1) -video_dir=$(dirname $video) -video_name=$(basename $video) - -output_tar=$2 -output_dir=$(dirname $output_tar) -mkdir -p $output_dir -output_dir=$(realpath $output_dir) -output_name=$(basename $output_tar) -tmp_dir=$(basename $output_tar | cut -d. -f1) - -docker run \ - --gpus all \ - --mount type=bind,source=$video_dir,target=/input \ - --mount type=bind,source=$output_dir,target=/output \ - registry.eps.surrey.ac.uk/openpose:15668 /bin/bash -c \ - "mkdir -p $tmp_dir && \ - ./build/examples/openpose/openpose.bin --video /input/$video_name --write_json $tmp_dir \ - --number_people_max 1 \ - --hand && \ - tar -czf /output/$output_name $tmp_dir" - -# chmod a=rwx $output_tar diff --git a/offline.sh b/offline.sh new file mode 100755 index 0000000..2db46c1 --- /dev/null +++ b/offline.sh @@ -0,0 +1,33 @@ +#! /bin/bash +video=$(realpath $1) +video_dir=$(dirname $video) +video_name=$(basename $video) + +output_tar=$2 +output_dir=$(dirname $output_tar) +mkdir -p $output_dir +output_dir=$(realpath $output_dir) +output_name=$(basename $output_tar) +tmp_name=$(basename $output_tar | cut -d. -f1) + +docker run \ + --gpus all \ + --mount type=bind,source=$video_dir,target=/input \ + --mount type=bind,source=$output_dir,target=/output \ + --user $(id -u):$(id -g) \ + registry.eps.surrey.ac.uk/openpose:15668 \ + /bin/bash -c \ + "mkdir -p /tmp/$tmp_name && \ + ./build/examples/openpose/openpose.bin \ + --video /input/$video_name \ + --write_json /tmp/$tmp_name \ + --number_people_max 1 \ + --scale_number 4 \ + --scale_gap 0.25 \ + --hand \ + --hand_scale_number 6 \ + --hand_scale_range 0.4 \ + --display 0 \ + --render_pose 0 && \ + cd /tmp && \ + tar -czf /output/$output_name $tmp_name" diff --git a/online.sh b/online.sh new file mode 100755 index 0000000..0e9a3ac --- /dev/null +++ b/online.sh @@ -0,0 +1,22 @@ +#! /bin/bash + +xhost local:root + +output_dir=$1 +mkdir -p $output_dir +output_dir=$(realpath $output_dir) + +docker run \ + --gpus all \ + --env="DISPLAY" \ + --net=host \ + --device=/dev/video0:/dev/video0 \ + --mount type=bind,source=$HOME/.Xauthority,target=/root/.Xauthority:rw \ + --mount type=bind,source=$output_dir,target=/output \ + -it \ + registry.eps.surrey.ac.uk/openpose:15668 \ + /bin/bash -c \ + "./build/examples/openpose/openpose.bin \ + --write_json /output \ + --number_people_max 1 \ + --hand" diff --git a/viz.sh b/viz.sh new file mode 100755 index 0000000..c57b8db --- /dev/null +++ b/viz.sh @@ -0,0 +1,33 @@ +#! /bin/bash + +xhost local:root + +video=$(realpath $1) +video_dir=$(dirname $video) +video_name=$(basename $video) + +output_tar=$2 +output_dir=$(dirname $output_tar) +mkdir -p $output_dir +output_dir=$(realpath $output_dir) +output_name=$(basename $output_tar) +tmp_name=$(basename $output_tar | cut -d. -f1) + +docker run \ + --gpus all \ + --env="DISPLAY" \ + --net=host \ + --mount type=bind,source=$HOME/.Xauthority,target=/root/.Xauthority:rw \ + --mount type=bind,source=$video_dir,target=/input \ + --mount type=bind,source=$output_dir,target=/output \ + --user $(id -u):$(id -g) \ + registry.eps.surrey.ac.uk/openpose:15668 \ + /bin/bash -c \ + "mkdir -p /tmp/$tmp_name && \ + ./build/examples/openpose/openpose.bin \ + --video /input/$video_name \ + --write_json /tmp/$tmp_name \ + --number_people_max 1 \ + --hand && \ + cd /tmp && \ + tar -czf /output/$output_name $tmp_name" -- GitLab