@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