runcmd 2.49 KB
Newer Older
1
#!/bin/bash
2
myimage=local/dockervino:debug
Juan Diego's avatar
Juan Diego committed
3
myname=debug
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#################################
##### Display Parameters #####
#################################
# if run from a graphics window or shell, set some server params, else document what is needed
[ k$DISPLAY = k ] && doit=echo
# X11 Display and access file (to us in XAUTORITY env)
# enable access from anywhere (used for containers)
$doit xhost +
# disable screen saver
$doit xset s 0
# force screen to use (0 is usually the physical display of the system, others would be Xvnc virtual screens)
display=$DISPLAY
rm -f ./xauthority ; cp $XAUTHORITY ./xauthority ;chmod 666 ./xauthority #else root user inside container cannot open

#################################
#####  General Parameters  ######
#################################
# Init Openvino environment
setupvars=/opt/intel/openvino/bin/setupvars.sh
Juan Diego Gonzales's avatar
Juan Diego Gonzales committed
24
examples_dir=/root/omz_demos_build/intel64/Release
25
26
models_dir=/root/openvino_models/ir
# Input: IPCam or USBCam
27
input=/videos/test.mp4                #input=http://94.214.173.241:8001/mjpg/video.mjpg
28
29
30
31
32
33

#################################
########    Examples  ###########
#################################

####### CPU Pose Estimation ########
ukhuracha's avatar
ukhuracha committed
34
35
device=CPU
app=${examples_dir}/human_pose_estimation_demo
36
model=${models_dir}/intel/human-pose-estimation-0001/FP32/human-pose-estimation-0001.xml
37
38

###### NCS2 Pose Estimation  ######
ukhuracha's avatar
ukhuracha committed
39
40
#device=MYRIAD
#app=${examples_dir}/human_pose_estimation_demo
41
#model=${models_dir}/intel/human-pose-estimation-0001/FP16/human-pose-estimation-0001.xml
42
43

# Running the container
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
44
45
46
47
set -x
docker run \
  -d \
  -ti \
48
  --mount type=bind,source="$(pwd)"/../../open_model_zoo,target=/opt/intel/openvino/deployment_tools/open_model_zoo \
49
  --mount type=bind,source="$(pwd)"/videos,target=/videos \
50
  --privileged \
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
51
  --net=host \
52
53
54
55
56
57
58
59
60
  --env="setupvars=$setupvars" \
  --env="DISPLAY=$display" \
  --env="input=$input" \
  --env="device=$device" \
  --env="app=$app" \
  --env="model=$model" \
  --env="agM=$agM" \
  --env="emM=$emM" \
  --env="hpM=$hpM" \
61
62
  --device="/dev/video0:/dev/video0" \
  --volume="/dev:/dev" \
63
  --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
64
65
66
67
68
  --env="PS1=$myname> "\
  --publish-all=true \
  --hostname=$myname \
  --name $myname \
  --cidfile=/tmp/monitcont.id \
69
        $myimage /bin/bash
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
70
71
72
73
        contid=$(cat /tmp/monitcont.id; rm -f /tmp/monitcont.id)
set +x
        $debug docker logs $contid
        $debug docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $1 $contid