diff --git a/ONLINE.sh b/ONLINE.sh new file mode 100644 index 0000000000000000000000000000000000000000..2a50637812e3e46859f5da20b6c7d40993cc757f --- /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