forked from ai-forever/Real-ESRGAN
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRun_Inference_UI.bat
More file actions
49 lines (36 loc) · 1.27 KB
/
Run_Inference_UI.bat
File metadata and controls
49 lines (36 loc) · 1.27 KB
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
@echo off
setlocal
REM Check if venv_ui folder exists in the root directory
if not exist "%~dp0venv_ui\" (
REM Print the step to the terminal
echo Creating virtual environment...
REM Create a virtual environment named "venv_ui" in the root directory
python -m venv "%~dp0venv_ui"
)
REM Print the step to the terminal
echo Activating the virtual environment...
REM Activate the virtual environment
call "%~dp0venv_ui\Scripts\activate.bat"
REM Check if the required packages are already installed
echo Checking if required packages are installed...
pip show gradio >nul 2>&1
if %errorlevel% equ 0 (
echo Required packages are already installed. Skipping requirements installation.
) else (
REM Print the step to the terminal
echo Installing requirements...
REM Install requirements inside the virtual environment
pip install -r "%~dp0Scripts\requirements_ui.txt"
)
REM Print the step to the terminal
echo Running Python script...
REM Run your Python file here
python "%~dp0Scripts\Run_Inference_UI.py"
REM Print the step to the terminal
echo Deactivating the virtual environment...
REM Deactivate the virtual environment
call "%~dp0venv_ui\Scripts\deactivate.bat"
REM Print the step to the terminal
echo Script execution complete.
endlocal
pause /k