-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupDockerContainer.cmd
43 lines (34 loc) · 1.28 KB
/
setupDockerContainer.cmd
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
::Alter these variables to your liking to customize the docker container setup
SET imageTag=pupiltracking
SET containerName=pupiltracking
SET videoMountDirectory=D:\pupilltracker\pupil_tracking\videos
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SET parent=%~dp0
Call :DownloadAndExtractMediapipe
ECHO Building Image
docker build --tag=%imageTag% .
ECHO Creating and running container
docker run -v %parent%:/hcmlabpupiltracking -v %videoMountDirectory%:/videos -it -p 9876:9876 --name %containerName% %imageTag%:latest
PAUSE
EXIT /B 0
::Download mediapipe if not already present
:DownloadAndExtractMediapipe
IF NOT EXIST "deps" (
ECHO Creating deps directory
mkdir deps
)
cd deps
IF NOT EXIST "mediapipe-0.8.2" (
IF NOT EXIST "0.8.2.zip" (
ECHO Downloading mediapipe
wget https://github.com/google/mediapipe/archive/refs/tags/0.8.2.zip
)
ECHO Unzipping mediapipe
REM unzip "%parent%\deps\0.8.2.zip" to "%parent%\deps\mediapipe-0.8.2\"
powershell.exe -nologo -noprofile -command "& { $shell = New-Object -COM Shell.Application; $target = $shell.NameSpace('%parent%deps\'); $zip = $shell.NameSpace('%parent%deps\0.8.2.zip'); $target.CopyHere($zip.Items(), 16); }"
ECHO Unzipped mediapipe to %parent%\deps\mediapipe-0.8.2\
DEL 0.8.2.zip
)
cd %parent%
EXIT /B 0