Docker working locally. Continuous Deployment rules added (push to dockerhub)
This commit is contained in:
parent
172101aab6
commit
7d77d459bf
2 changed files with 88 additions and 23 deletions
|
|
@ -385,6 +385,27 @@ def display_class_legend(model_info):
|
|||
</div>
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
# # Sidebar avec informations du modèle
|
||||
# with st.sidebar:
|
||||
# st.markdown("## 🔧 Informations du Modèle")
|
||||
|
||||
# model_info = get_model_info()
|
||||
# if model_info:
|
||||
# st.success("✅ Modèle chargé")
|
||||
# st.write(f"**Nom:** {model_info.get('model_name', 'N/A')}")
|
||||
# st.write(f"**Encoder:** {model_info.get('encoder', 'N/A')}")
|
||||
# st.write(f"**Classes:** {model_info.get('num_classes', 'N/A')}")
|
||||
# st.write(f"**Taille d'entrée:** {model_info.get('input_size', 'N/A')}")
|
||||
# st.write(f"**Run ID:** {model_info.get('run_id', 'N/A')[:8]}...")
|
||||
# else:
|
||||
# st.error("❌ Modèle non disponible")
|
||||
|
||||
# st.markdown("---")
|
||||
# st.markdown("## 🎯 Classes Segmentées")
|
||||
# if model_info and 'class_names' in model_info:
|
||||
# for i, class_name in enumerate(model_info['class_names']):
|
||||
# st.write(f"{i}. {class_name}")
|
||||
|
||||
# Sidebar avec informations du modèle
|
||||
with st.sidebar:
|
||||
st.markdown("## 🔧 Informations du Modèle")
|
||||
|
|
@ -402,9 +423,43 @@ with st.sidebar:
|
|||
|
||||
st.markdown("---")
|
||||
st.markdown("## 🎯 Classes Segmentées")
|
||||
|
||||
# ✨ NOUVEAU: Affichage avec carrés colorés
|
||||
if model_info and 'class_names' in model_info and 'class_colors' in model_info:
|
||||
class_names = model_info['class_names']
|
||||
class_colors = model_info['class_colors']
|
||||
|
||||
for i, (class_name, color) in enumerate(zip(class_names, class_colors)):
|
||||
# Convertir RGB en hex
|
||||
color_hex = f"#{color[0]:02x}{color[1]:02x}{color[2]:02x}"
|
||||
|
||||
# Affichage avec carré coloré
|
||||
st.markdown(f"""
|
||||
<div style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0.3rem 0;
|
||||
font-size: 0.9rem;
|
||||
">
|
||||
<div style="
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background-color: {color_hex};
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgba(0,0,0,0.2);
|
||||
flex-shrink: 0;
|
||||
"></div>
|
||||
<span style="font-weight: 500;">{i}. {class_name}</span>
|
||||
</div>
|
||||
""", unsafe_allow_html=True)
|
||||
else:
|
||||
# Fallback si pas d'info couleur
|
||||
if model_info and 'class_names' in model_info:
|
||||
for i, class_name in enumerate(model_info['class_names']):
|
||||
st.write(f"{i}. {class_name}")
|
||||
else:
|
||||
st.write("Informations des classes non disponibles")
|
||||
|
||||
|
||||
# Initialisation des états - MODIFIÉE pour séparer les résultats par onglet
|
||||
|
|
|
|||
|
|
@ -1,38 +1,48 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
multiseg-api:
|
||||
street-vision-api:
|
||||
# Pour développement local (build)
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: multisegmentation_api
|
||||
|
||||
# Pour production (image Docker Hub)
|
||||
# image: docker.io/VOTRE-USERNAME/street-vision_api:latest
|
||||
|
||||
container_name: street_vision_api
|
||||
|
||||
ports:
|
||||
- "${NGINX_PORT:-8080}:${NGINX_PORT:-8080}" # Port configurable, défaut 8080
|
||||
- "${NGINX_PORT:-8080}:${NGINX_PORT:-8080}" # Port nginx configurable
|
||||
|
||||
environment:
|
||||
# Configuration du port nginx
|
||||
NGINX_PORT: "${NGINX_PORT:-8080}"
|
||||
|
||||
# Configuration MLflow pour le suivi des modèles
|
||||
MLFLOW_TRACKING_URI: "${MLFLOW_TRACKING_URI}" # ex: http://mlflow:5000
|
||||
MLFLOW_S3_ENDPOINT_URL: "${MLFLOW_S3_ENDPOINT_URL}" # ex: http://minio:9000 ou https://s3.amazonaws.com
|
||||
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}" # clé d'accès S3/MinIO
|
||||
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}" # clé secrète S3/MinIO
|
||||
MLFLOW_TRACKING_URI: "${MLFLOW_TRACKING_URI}" # ex: https://mlflow.domain.com
|
||||
MLFLOW_S3_ENDPOINT_URL: "${MLFLOW_S3_ENDPOINT_URL}" # ex: url MinIO ou S3
|
||||
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}" # clé ID S3
|
||||
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}" # clé secrète S3
|
||||
|
||||
# Configuration email pour notifications (optionnel)
|
||||
SMTP_SERVER: "${SMTP_SERVER}" # ex: smtp.gmail.com
|
||||
SMTP_PORT: "${SMTP_PORT}" # ex: 587
|
||||
SMTP_EMAIL: "${SMTP_EMAIL}" # ex: noreply@company.com
|
||||
SMTP_PASSWORD: "${SMTP_PASSWORD}" # mot de passe d'application SMTP
|
||||
SMTP_FROM_ALIAS: "${SMTP_FROM_ALIAS}" # ex: "Multi-Segmentation API"
|
||||
ADMIN_EMAIL: "${ADMIN_EMAIL}" # ex: admin@company.com
|
||||
SMTP_SERVER: "${SMTP_SERVER}" # serveur SMTP
|
||||
SMTP_PORT: "${SMTP_PORT}" # port SMTP (ex: 587)
|
||||
SMTP_EMAIL: "${SMTP_EMAIL}" # email expéditeur
|
||||
SMTP_PASSWORD: "${SMTP_PASSWORD}" # mot de passe SMTP
|
||||
SMTP_FROM_ALIAS: "${SMTP_FROM_ALIAS}" # alias (optionnel)
|
||||
ADMIN_EMAIL: "${ADMIN_EMAIL}" # email admin destinataire
|
||||
|
||||
# URL de base de l'API (utilisée par Streamlit pour les appels API)
|
||||
MULTISEG_API_BASE_URL: "${MULTISEG_API_BASE_URL}" # ex: http://localhost:8080/api ou https://your-domain.com/api
|
||||
# URL de base de l'API (utilisée par Streamlit pour rediriger vers FastAPI)
|
||||
MULTISEG_API_BASE_URL: "${MULTISEG_API_BASE_URL}" # ex: https://vision.domain.com/api
|
||||
|
||||
# Seulement si vous avez un reverse proxy server
|
||||
# networks:
|
||||
# - swag
|
||||
|
||||
# only if you have a reverse proxy server (like nginx-proxy or Traefik)
|
||||
# networks:
|
||||
# - proxy
|
||||
restart: always
|
||||
|
||||
# only if you have a reverse proxy server
|
||||
# Seulement si vous avez un reverse proxy server
|
||||
# networks:
|
||||
# proxy:
|
||||
# swag:
|
||||
# external: true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue