File size: 1,001 Bytes
36fcf33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@echo off
REM Batch script to run the FastAPI application from app.py
REM Run this script from the project root directory

echo =========================================
echo Starting SAM2 Image Auto Segment API
echo =========================================
echo.

REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
    echo ERROR: Python is not installed or not in PATH!
    echo Please install Python 3.10 or higher from https://www.python.org/
    pause
    exit /b 1
)

REM Set default port (can be overridden with PORT environment variable)
set PORT=8000
if not "%PORT%"=="" (
    echo Using port: %PORT%
) else (
    echo Using default port: 8000
)

echo.
echo Starting FastAPI server...
echo API will be available at: http://localhost:%PORT%
echo API documentation at: http://localhost:%PORT%/docs
echo.
echo Press Ctrl+C to stop the server
echo.

REM Run the FastAPI application using uvicorn
python -m uvicorn app:app --host 0.0.0.0 --port %PORT% --reload

pause