File size: 1,943 Bytes
7d6df10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# YOLOv5 Web Application - Startup Script
# Lancement automatique du serveur FastAPI avec interface web

Write-Host "========================================" -ForegroundColor Cyan
Write-Host "   YOLOv5 Web Application Launcher" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""

# Check if Python is installed
try {
    $pythonVersion = python --version 2>&1
    Write-Host "✓ Python detecté: $pythonVersion" -ForegroundColor Green
} catch {
    Write-Host "✗ Python non trouvé! Installez Python d'abord." -ForegroundColor Red
    exit 1
}

# Navigate to backend directory
$backendPath = Join-Path $PSScriptRoot "backend"
Set-Location $backendPath

Write-Host ""
Write-Host "📦 Vérification des dépendances..." -ForegroundColor Yellow

# Check if requirements are installed
$requirementsFile = Join-Path $backendPath "requirements.txt"
if (Test-Path $requirementsFile) {
    Write-Host "Installation/Mise à jour des dépendances..." -ForegroundColor Yellow
    pip install -r requirements.txt --quiet
    Write-Host "✓ Dépendances installées" -ForegroundColor Green
}

Write-Host ""
Write-Host "🚀 Démarrage du serveur YOLOv5..." -ForegroundColor Cyan
Write-Host ""
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Blue
Write-Host "  Application Web: http://localhost:8000" -ForegroundColor Green
Write-Host "  API Documentation: http://localhost:8000/docs" -ForegroundColor Green
Write-Host "  WebSocket: ws://localhost:8000/ws" -ForegroundColor Green
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Blue
Write-Host ""
Write-Host "💡 Appuyez sur Ctrl+C pour arrêter le serveur" -ForegroundColor Yellow
Write-Host ""

# Start the FastAPI server
python main.py