From 5a0943c84ed105fe13f72b4759fc79e45388a764 Mon Sep 17 00:00:00 2001 From: "Rochette, Guillaume L (PG/R - Elec Electronic Eng)" <g.rochette@surrey.ac.uk> Date: Mon, 10 Feb 2020 13:30:53 +0000 Subject: [PATCH] Upload New File --- ONLINE.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ONLINE.sh diff --git a/ONLINE.sh b/ONLINE.sh new file mode 100644 index 0000000..2a50637 --- /dev/null +++ b/ONLINE.sh @@ -0,0 +1,26 @@ +#! /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 -- GitLab