File size: 2,163 Bytes
0cbbc0f
 
0c42503
 
 
0cbbc0f
0c42503
0cbbc0f
 
 
ab51159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4622aca
ab51159
 
 
 
 
 
 
 
 
4622aca
 
ab51159
 
 
 
 
 
 
 
 
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
71
72
73
74
75
76
77
78
79
---
title: Computer Vison | Image Classification
emoji: 🤖
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
---

# Intel Scene Classifier — Déploiement

## Structure du projet
```
webapp/
├── app.py                  ← Backend Flask
├── templates/
│   └── index.html          ← Interface web
├── parfait_model.pth       ← ⚠️ À placer ici (téléchargé depuis Kaggle)
├── parfait_model.keras     ← ⚠️ À placer ici (téléchargé depuis Kaggle)
├── requirements.txt
├── Procfile
└── README.md
```

> ⚠️ **Important** : Placez `parfait_model.pth` et `parfait_model.keras`
> à la racine du projet avant de déployer.

---

## Option A — PythonAnywhere (recommandé, gratuit)

1. Créez un compte sur https://www.pythonanywhere.com
2. Onglet **Files** → uploadez tous vos fichiers (y compris les modèles .pth et .keras)
3. Onglet **Consoles** → ouvrir un Bash :
   ```bash
   pip install -r requirements.txt
   ```
4. Onglet **Web** → Add a new web app → Manual configuration → Python 3.10
5. Dans **WSGI configuration file**, remplacez le contenu par :
   ```python
   import sys
   sys.path.insert(0, '/home/VOTRE_USERNAME')
   from app import app as application
   ```
6. **Reload** → votre app est en ligne !

---

## Option B — Railway (gratuit, très simple)

1. Créez un compte sur https://railway.app
2. **New Project** → Deploy from GitHub (poussez votre code sur GitHub d'abord)
3. Railway détecte automatiquement le `Procfile`
4. Ajoutez vos fichiers modèles via **Volume** ou committez-les dans le repo
5. Deploy → URL générée automatiquement

---

## Option C — Render (gratuit)

1. https://render.com → New Web Service
2. Connectez votre repo GitHub
3. Build Command : `pip install -r requirements.txt`
4. Start Command : `gunicorn app:app --bind 0.0.0.0:$PORT --workers 1 --timeout 120`
5. Uploadez les modèles dans le repo ou via un bucket S3

---

## Lancer en local

```bash
pip install -r requirements.txt

# Placez parfait_model.pth et parfait_model.keras ici, puis :
python app.py
# → http://localhost:5000
```