-
Notifications
You must be signed in to change notification settings - Fork 58
/
install.bat
67 lines (53 loc) · 1.79 KB
/
install.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
@echo off
set MODEL_SETUP=0
if "%1" NEQ "" (
if /I "%1"=="-i" (
set MODEL_SETUP=1
) else (
if /I "%1"=="--install_models" (
set MODEL_SETUP=1
) else (
echo Invalid option: %1
echo Use -i or --install_models to run model setup.
exit /b
)
)
)
REM Get the directory of the currently executing script
set script_dir=%~dp0
REM Remove the trailing backslash
set script_dir=%script_dir:~0,-1%
REM Get the current working directory
set current_dir=%cd%
REM Compare the directories
if /i "%script_dir%"=="%current_dir%" (
REM If they are the same, move up one directory
cd ..
) else (
echo.
)
echo **** openvino-ai-plugins-gimp Setup started ****
REM Install virtualenv if not already installed
python -m pip install virtualenv | find /V "already satisfied"
REM Create a virtual environment
python -m virtualenv gimpenv3
call "gimpenv3\Scripts\activate"
REM Install required packages
pip install wmi
pip install -r "%~dp0\requirements.txt" | find /V "already satisfied"
pip install "%~dp0\."
python -c "from gimpopenvino import complete_install; complete_install.setup_python_weights(repo_weights_dir=r'%script_dir%\weights')"
echo **** openvino-ai-plugins-gimp Setup Ended ****
call deactivate
rem cls
echo.
REM copy to gimp plugin dir
echo Installing plugin in "%appdata%\GIMP\2.99\plug-ins"
for /d %%d in (openvino_utils semseg_ov stable_diffusion_ov superresolution_ov ) do ( robocopy "gimpenv3\Lib\site-packages\gimpopenvino\plugins\%%d" "%appdata%\GIMP\2.99\plug-ins\%%d" /mir /NFL /NDL /NJH /NJS /nc /ns /np )
echo *** openvino-ai-plugins-gimp Installed ***
echo.
if %MODEL_SETUP% EQU 1 (
echo **** OpenVINO MODEL SETUP STARTED ****
gimpenv3\Scripts\python.exe "%~dp0\model_setup.py"
)
exit /b