From 9777572ac196c6757bb9d8ff705b89ad59c4c501 Mon Sep 17 00:00:00 2001 From: Aydin <108932477+Aydinhamedi@users.noreply.github.com> Date: Thu, 14 Mar 2024 21:58:06 +0330 Subject: [PATCH] modified: Interface/GUI/Data/requirements.txt modified: Interface/GUI/GUI.cmd --- Interface/GUI/Data/requirements.txt | 4 ++-- Interface/GUI/GUI.cmd | 24 +++++++++++++++--------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Interface/GUI/Data/requirements.txt b/Interface/GUI/Data/requirements.txt index 74b149d..754bae1 100644 --- a/Interface/GUI/Data/requirements.txt +++ b/Interface/GUI/Data/requirements.txt @@ -4,8 +4,8 @@ numpy==1.25.1 opencv-python==4.8.0.74 pillow==10.2.0 py-cpuinfo==9.0.0 -pydicom==2.4.4 -PySimpleGUI==4.60.5 +pydicom==2.4.3 +PySimpleGUI==5.0.3 requests==2.31.0 tensorflow==2.10.1 tqdm==4.66.2 diff --git a/Interface/GUI/GUI.cmd b/Interface/GUI/GUI.cmd index c705f13..95c04d4 100644 --- a/Interface/GUI/GUI.cmd +++ b/Interface/GUI/GUI.cmd @@ -1,8 +1,9 @@ @echo off REM Conf: setlocal enabledelayedexpansion -TITLE Pneumonia-Detection-Ai-GUI +TITLE Pneumonia-Detection-Ai-GUI-Launcher set python_min_VER=10 +set python_max_VER=10 set DEBUG=0 set Full_Auto=1 set arg=%1 @@ -44,14 +45,18 @@ echo Checking Python version... REM Ensure Python version is %python_min_VER% or higher for /F "tokens=2 delims=." %%i IN ('"%python_path%" --version 2^>^&1') DO set python_version_major=%%i if %python_version_major% LSS %python_min_VER% ( - echo Warning: Please update your Python version to 3.%python_min_VER%.x or higher! + echo Warning: Please uninstall python and install Python 3.%python_max_VER%.x ^(Ver too low^) + pause + exit /B +) else if %python_version_major% GTR %python_max_VER% ( + echo Warning: Please uninstall python and install Python 3.%python_max_VER%.x ^(Ver too high^) pause exit /B ) REM Check if the required packages are installed echo Checking the required packages... -for /F "usebackq delims==" %%i in ("Data\requirements.txt") do ( +for /F "usebackq delims=" %%i in ("Data\requirements.txt") do ( call :check_install %%i ) REM Write the current Python version + Python install time to the file @@ -87,22 +92,23 @@ goto :EOF :check_install REM Check if a package is installed and offer to install it if not set userinput=Y -"%pip_path%" show %1 >nul +set "P_name=%~1==%~2" +"%pip_path%" show %~1 >nul 2>&1 if ERRORLEVEL 1 ( if not "%Full_Auto%"=="1" ( - echo Package %1 not found. Do you want to automatically install it? [Y/n] + echo Package %P_name% not found. Do you want to automatically install it? [Y/n] set /p userinput="Answer: " ) if /I "%userinput%"=="Y" ( - echo Installing package %1 - "%pip_path%" install %1 + echo Installing package %P_name% + "%pip_path%" install %P_name% if ERRORLEVEL 1 ( - echo Failed to install package %1. + echo Failed to install package %P_name%. Pause goto :EOF ) ) ) else if "%DEBUG%"=="1" ( - echo Package %1 is already installed. + echo Package %P_name% is already installed. ) GOTO:EOF \ No newline at end of file