-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.bat
75 lines (56 loc) · 1.4 KB
/
setup.bat
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@echo off
goto main
:dlib_install
set "PYTHON_EXE=%VIRTUAL_ENV%\Scripts\python.exe"
if not exist %PYTHON_EXE% (
echo Creating virtual environment...
python -m venv venv
)
@REM echo Activating virtual environment...
@REM call %VIRTUAL_ENV%\Scripts\activate.bat
echo Installing prerequisites...
pip install numpy setuptools cmake wheel
echo Cloning dlib repository...
git clone https://github.com/davisking/dlib.git
echo Building and installing dlib...
cd dlib
mkdir build
cd build
cmake -G "Visual Studio 16 2019" ..
cmake --build . --config Release
cd ..
%PYTHON_EXE% setup.py install
echo Cleaning up...
cd ..
rmdir /s /q dlib
echo Done.
goto :eof
:main
set "PYTHON_EXE=%VIRTUAL_ENV%\Scripts\python.exe"
if not exist %PYTHON_EXE% (
echo Creating virtual environment...
python -m venv venv
)
@REM echo Activating virtual environment...
@REM call %VIRTUAL_ENV%\Scripts\activate.bat
echo Updating pip...
%PYTHON_EXE% -m pip install --upgrade pip
echo Installing dependencies...
%PYTHON_EXE% -m pip install -r requirements.txt
echo Checking for dlib...
%PYTHON_EXE% -c "import dlib"
if %errorlevel% neq 0 (
echo Installing dlib from binary...
call :dlib_install
) else (
echo dlib found...
)
cls
echo Checking if .env file exists...
if not exist .env (
echo Creating .env file...
copy .env.example .env > nul
echo Please edit the SECRET_KEY variable in the .env file.
)
echo Setup complete!
goto :eof