| --- |
| 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 |
| ``` |
|
|