-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_and_run.bat
More file actions
70 lines (62 loc) · 1.59 KB
/
setup_and_run.bat
File metadata and controls
70 lines (62 loc) · 1.59 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@echo off
REM Quick Setup Script for ImageSense Analyzer (Windows)
REM Run this to install and run the application
echo ==========================================
echo ImageSense Analyzer - Quick Setup
echo ==========================================
echo.
REM Check Python
echo Checking Python installation...
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo X Python is not installed!
echo Please install Python 3.9 or higher from python.org
pause
exit /b 1
)
echo √ Python found
echo.
REM Check for API key
echo Checking for OpenAI API key...
if "%OPENAI_API_KEY%"=="" (
echo Warning: OPENAI_API_KEY not set!
echo.
echo Please set your API key:
echo setx OPENAI_API_KEY "your-key-here"
echo.
echo Then restart this script.
echo.
set /p API_KEY="Enter your OpenAI API key (or press Enter to exit): "
if "%API_KEY%"=="" (
echo.
echo X Cannot proceed without API key
pause
exit /b 1
)
setx OPENAI_API_KEY "%API_KEY%"
echo.
echo √ API key saved
echo Please restart this script for changes to take effect.
pause
exit /b 0
) else (
echo √ API key found
)
echo.
REM Install dependencies
echo Installing dependencies...
pip install -r requirements.txt
if %errorlevel% neq 0 (
echo X Failed to install dependencies
pause
exit /b 1
)
echo √ Dependencies installed successfully
echo.
REM Run the application
echo ==========================================
echo Starting ImageSense Analyzer...
echo ==========================================
echo.
python image_analyzer_app.py
pause