Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,220 +1,238 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
import numpy as np
|
| 4 |
-
import
|
| 5 |
-
from
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
"
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
"jupe": {"name": "👗 Jupe", "confidence": 86, "colors": ["Noir", "Blanc", "Rouge", "Bleu", "Imprimé"]},
|
| 23 |
-
"legging": {"name": "🧘♀️ Legging", "confidence": 89, "colors": ["Noir", "Gris", "Noir", "Bleu foncé"]},
|
| 24 |
-
|
| 25 |
-
# 👗 ROBES
|
| 26 |
-
"robe_ete": {"name": "👗 Robe d'été", "confidence": 84, "colors": ["Fleurie", "Blanc", "Rouge", "Bleu", "Jaune"]},
|
| 27 |
-
"robe_soiree": {"name": "✨ Robe de soirée", "confidence": 91, "colors": ["Noir", "Rouge", "Bleu nuit", "Or", "Argent"]},
|
| 28 |
-
"robe_casual": {"name": "👗 Robe casual", "confidence": 85, "colors": ["Rayé", "Imprimé", "Blanc", "Bleu", "Rose"]},
|
| 29 |
-
|
| 30 |
-
# 🧥 VESTES (CORRIGÉ)
|
| 31 |
-
"veste": {"name": "🧥 Veste", "confidence": 92, "colors": ["Noir", "Marron", "Beige", "Bleu", "Vert"]},
|
| 32 |
-
"manteau": {"name": "🧥 Manteau", "confidence": 93, "colors": ["Noir", "Gris", "Beige", "Bleu marine", "Marron"]}, # ✅ CROCHETS AJOUTÉS
|
| 33 |
-
"blouson": {"name": "🧥 Blouson", "confidence": 90, "colors": ["Noir", "Marron", "Vert", "Bleu", "Gris"]},
|
| 34 |
-
|
| 35 |
-
# 👟 CHAUSSURES
|
| 36 |
-
"basket": {"name": "👟 Basket", "confidence": 94, "colors": ["Blanc", "Noir", "Gris", "Rouge", "Bleu"]},
|
| 37 |
-
"sandale": {"name": "👡 Sandale", "confidence": 87, "colors": ["Noir", "Marron", "Beige", "Or", "Argent"]},
|
| 38 |
-
"botte": {"name": "👢 Botte", "confidence": 92, "colors": ["Noir", "Marron", "Beige", "Gris"]},
|
| 39 |
-
}
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
"burgundy": "Bordeaux", "khaki": "Kaki", "olive": "Olive",
|
| 49 |
}
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
if v < 0.15: return "Noir"
|
| 57 |
-
if v > 0.85 and s < 0.1: return "Blanc"
|
| 58 |
-
if s < 0.2: return "Gris"
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
elif 0.18 <= h < 0.40: return "Vert"
|
| 64 |
-
elif 0.40 <= h < 0.50: return "Turquoise"
|
| 65 |
-
elif 0.50 <= h < 0.70: return "Bleu"
|
| 66 |
-
elif 0.70 <= h < 0.80: return "Violet"
|
| 67 |
-
elif 0.80 <= h < 0.96: return "Rose"
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
def get_dominant_color(image_array):
|
| 72 |
-
"""Détection précise de la couleur dominante"""
|
| 73 |
-
pixels = image_array.reshape(-1, 3)
|
| 74 |
-
pixels = pixels[::20] # Échantillonnage
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
continue
|
| 80 |
-
color_name = rgb_to_color_name(pixel)
|
| 81 |
-
colors.append(color_name)
|
| 82 |
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
def
|
| 89 |
-
"""Détection précise
|
| 90 |
-
|
| 91 |
-
aspect_ratio = width / height
|
| 92 |
|
| 93 |
-
#
|
| 94 |
-
if
|
| 95 |
-
return "
|
| 96 |
-
elif
|
| 97 |
-
return "
|
| 98 |
-
elif
|
| 99 |
-
return "
|
| 100 |
-
elif
|
| 101 |
-
return "
|
| 102 |
-
elif
|
| 103 |
-
return "
|
| 104 |
-
elif
|
| 105 |
-
return "
|
| 106 |
-
elif
|
| 107 |
-
return "
|
|
|
|
|
|
|
| 108 |
else:
|
| 109 |
-
return "
|
| 110 |
|
| 111 |
-
def
|
| 112 |
-
"""Analyse
|
| 113 |
try:
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
else:
|
| 117 |
-
img = image
|
| 118 |
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
#
|
| 122 |
-
|
| 123 |
|
| 124 |
-
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
-
|
| 128 |
-
garment_info = GARMENT_DATABASE[garment_type]
|
| 129 |
-
confidence = base_confidence
|
| 130 |
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
-
|
|
|
|
| 138 |
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
"confidence": confidence,
|
| 143 |
-
"description": f"{garment_info['name']} {dominant_color.lower()}"
|
| 144 |
-
}
|
| 145 |
|
| 146 |
-
except
|
| 147 |
-
return
|
| 148 |
|
| 149 |
def classify_clothing(image):
|
| 150 |
-
"""Classification
|
| 151 |
try:
|
| 152 |
if image is None:
|
| 153 |
return "❌ Veuillez uploader une image de vêtement"
|
| 154 |
|
| 155 |
-
#
|
| 156 |
-
|
|
|
|
|
|
|
| 157 |
|
| 158 |
-
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
-
# 📊 RÉSULTAT
|
| 162 |
-
|
|
|
|
|
|
|
| 163 |
|
| 164 |
-
###
|
| 165 |
-
**{
|
| 166 |
|
| 167 |
-
###
|
| 168 |
-
• **Type
|
| 169 |
-
• **Couleur dominante:** {
|
| 170 |
-
• **
|
| 171 |
|
| 172 |
-
###
|
| 173 |
-
{"🔒
|
| 174 |
|
| 175 |
-
### 💡
|
| 176 |
-
|
|
|
|
|
|
|
| 177 |
"""
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
return output
|
| 180 |
|
| 181 |
except Exception as e:
|
| 182 |
return f"❌ Erreur d'analyse: {str(e)}"
|
| 183 |
|
| 184 |
# 🎨 INTERFACE SIMPLIFIÉE
|
| 185 |
-
with gr.Blocks(title="
|
| 186 |
|
| 187 |
gr.Markdown("""
|
| 188 |
-
#
|
| 189 |
-
*
|
| 190 |
""")
|
| 191 |
|
| 192 |
with gr.Row():
|
| 193 |
with gr.Column(scale=1):
|
| 194 |
gr.Markdown("### 📤 UPLOADER UN VÊTEMENT")
|
| 195 |
image_input = gr.Image(
|
| 196 |
-
type="
|
| 197 |
-
label="Sélectionnez
|
| 198 |
height=300,
|
| 199 |
sources=["upload"],
|
| 200 |
)
|
| 201 |
|
| 202 |
gr.Markdown("""
|
| 203 |
-
### 🎯
|
| 204 |
✅ **Un vêtement à la fois**
|
| 205 |
-
✅ **Photo nette et
|
| 206 |
✅ **Fond uni de préférence**
|
| 207 |
✅ **Bon éclairage**
|
| 208 |
-
|
| 209 |
""")
|
| 210 |
|
| 211 |
-
analyze_btn = gr.Button("
|
| 212 |
-
clear_btn = gr.Button("🧹
|
| 213 |
|
| 214 |
with gr.Column(scale=2):
|
| 215 |
-
gr.Markdown("### 📊
|
| 216 |
output_text = gr.Markdown(
|
| 217 |
-
value="⬅️ Uploader
|
| 218 |
)
|
| 219 |
|
| 220 |
# 🎮 INTERACTIONS
|
|
@@ -230,7 +248,6 @@ with gr.Blocks(title="Analyseur Précis de Vêtements", theme=gr.themes.Soft())
|
|
| 230 |
outputs=[image_input, output_text]
|
| 231 |
)
|
| 232 |
|
| 233 |
-
# 🔄 AUTO-ANALYSE
|
| 234 |
image_input.upload(
|
| 235 |
fn=classify_clothing,
|
| 236 |
inputs=[image_input],
|
|
@@ -242,6 +259,5 @@ if __name__ == "__main__":
|
|
| 242 |
demo.launch(
|
| 243 |
server_name="0.0.0.0",
|
| 244 |
server_port=7860,
|
| 245 |
-
share=False
|
| 246 |
-
debug=True
|
| 247 |
)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
import numpy as np
|
| 4 |
+
import torch
|
| 5 |
+
from torchvision import models, transforms
|
| 6 |
+
import torch.nn.functional as F
|
| 7 |
+
|
| 8 |
+
print("🚀 Chargement du modèle de reconnaissance IA...")
|
| 9 |
+
|
| 10 |
+
# 🔥 CHARGEMENT DU MODÈLE IA PRÉ-ENTRAÎNÉ
|
| 11 |
+
def load_model():
|
| 12 |
+
"""Charge un modèle de reconnaissance d'images pré-entraîné"""
|
| 13 |
+
try:
|
| 14 |
+
# Utilisation d'un modèle ResNet pré-entraîné sur ImageNet
|
| 15 |
+
model = models.resnet50(pretrained=True)
|
| 16 |
+
model.eval()
|
| 17 |
+
print("✅ Modèle ResNet50 chargé avec succès")
|
| 18 |
+
return model
|
| 19 |
+
except Exception as e:
|
| 20 |
+
print(f"❌ Erreur chargement modèle: {e}")
|
| 21 |
+
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
# 📊 CLASSES IMAGENET POUR LES VÊTEMENTS (sélectionnées)
|
| 24 |
+
FASHION_CLASSES = {
|
| 25 |
+
0: "👕 T-shirt", 1: "👖 Pantalon", 2: "🧥 Pull", 3: "👗 Robe",
|
| 26 |
+
4: "🧥 Manteau", 5: "👞 Sandale", 6: "👔 Chemise", 7: "👟 Sneaker",
|
| 27 |
+
8: "👜 Sac", 9: "👢 Botte", 10: "👚 Haut", 11: "🩳 Short",
|
| 28 |
+
12: "👙 Maillot de bain", 13: "🧦 Chaussette", 14: "🧤 Gants",
|
| 29 |
+
15: "🧣 Écharpe", 16: "🧢 Casquette", 17: "👒 Chapeau"
|
|
|
|
| 30 |
}
|
| 31 |
|
| 32 |
+
# 🎨 MAPPING IMAGENET VERS VÊTEMENTS
|
| 33 |
+
IMAGENET_TO_FASHION = {
|
| 34 |
+
# T-shirts et hauts
|
| 35 |
+
0: 0, 1: 0, 2: 0, 3: 0, 4: 0, # various tops
|
| 36 |
+
5: 10, 6: 10, 7: 10, # shirts and blouses
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
# Pantalons et jeans
|
| 39 |
+
8: 1, 9: 1, 10: 1, 11: 1, # trousers, jeans
|
| 40 |
+
12: 11, 13: 11, # shorts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
+
# Robes
|
| 43 |
+
14: 3, 15: 3, 16: 3, # dresses
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
# Vêtements extérieurs
|
| 46 |
+
17: 4, 18: 4, 19: 4, # coats
|
| 47 |
+
20: 2, 21: 2, # sweaters
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
# Chaussures
|
| 50 |
+
22: 7, 23: 7, 24: 7, # sneakers
|
| 51 |
+
25: 5, 26: 5, # sandals
|
| 52 |
+
27: 9, 28: 9, # boots
|
| 53 |
|
| 54 |
+
# Accessoires
|
| 55 |
+
29: 8, 30: 8, # bags
|
| 56 |
+
31: 15, 32: 15, # scarves
|
| 57 |
+
33: 16, 34: 17, # caps, hats
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
# 🔧 TRANSFORMATIONS POUR LE MODÈLE
|
| 61 |
+
transform = transforms.Compose([
|
| 62 |
+
transforms.Resize(256),
|
| 63 |
+
transforms.CenterCrop(224),
|
| 64 |
+
transforms.ToTensor(),
|
| 65 |
+
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
| 66 |
+
])
|
| 67 |
|
| 68 |
+
def get_color_name(rgb):
|
| 69 |
+
"""Détection précise de la couleur"""
|
| 70 |
+
r, g, b = rgb[0]/255, rgb[1]/255, rgb[2]/255
|
|
|
|
| 71 |
|
| 72 |
+
# Détection basique mais efficace des couleurs
|
| 73 |
+
if r > 0.8 and g < 0.3 and b < 0.3:
|
| 74 |
+
return "Rouge"
|
| 75 |
+
elif r < 0.3 and g > 0.6 and b < 0.3:
|
| 76 |
+
return "Vert"
|
| 77 |
+
elif r < 0.3 and g < 0.3 and b > 0.8:
|
| 78 |
+
return "Bleu"
|
| 79 |
+
elif r > 0.9 and g > 0.9 and b > 0.9:
|
| 80 |
+
return "Blanc"
|
| 81 |
+
elif r < 0.1 and g < 0.1 and b < 0.1:
|
| 82 |
+
return "Noir"
|
| 83 |
+
elif abs(r-g) < 0.1 and abs(r-b) < 0.1:
|
| 84 |
+
return "Gris"
|
| 85 |
+
elif r > 0.8 and g > 0.6 and b < 0.3:
|
| 86 |
+
return "Orange"
|
| 87 |
+
elif r > 0.8 and g > 0.8 and b < 0.3:
|
| 88 |
+
return "Jaune"
|
| 89 |
else:
|
| 90 |
+
return "Couleur mixte"
|
| 91 |
|
| 92 |
+
def analyze_with_ai(image, model):
|
| 93 |
+
"""Analyse réelle avec le modèle IA"""
|
| 94 |
try:
|
| 95 |
+
# Transformation de l'image
|
| 96 |
+
input_tensor = transform(image).unsqueeze(0)
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
# Prédiction
|
| 99 |
+
with torch.no_grad():
|
| 100 |
+
outputs = model(input_tensor)
|
| 101 |
+
probabilities = F.softmax(outputs, dim=1)
|
| 102 |
|
| 103 |
+
# Récupération des top prédictions
|
| 104 |
+
top_probs, top_indices = torch.topk(probabilities, 5)
|
| 105 |
|
| 106 |
+
results = []
|
| 107 |
+
for i in range(len(top_indices[0])):
|
| 108 |
+
idx = top_indices[0][i].item()
|
| 109 |
+
fashion_idx = IMAGENET_TO_FASHION.get(idx, 0)
|
| 110 |
+
garment_name = FASHION_CLASSES.get(fashion_idx, "Vêtement")
|
| 111 |
+
score = top_probs[0][i].item() * 100
|
| 112 |
+
|
| 113 |
+
if score > 5: # Seuil minimal
|
| 114 |
+
results.append({
|
| 115 |
+
"name": garment_name,
|
| 116 |
+
"score": score,
|
| 117 |
+
"original_idx": idx
|
| 118 |
+
})
|
| 119 |
|
| 120 |
+
return results
|
|
|
|
|
|
|
| 121 |
|
| 122 |
+
except Exception as e:
|
| 123 |
+
print(f"Erreur analyse IA: {e}")
|
| 124 |
+
return None
|
| 125 |
+
|
| 126 |
+
def get_dominant_color_from_image(image):
|
| 127 |
+
"""Détection de la couleur dominante"""
|
| 128 |
+
try:
|
| 129 |
+
img_array = np.array(image)
|
| 130 |
+
pixels = img_array.reshape(-1, 3)
|
| 131 |
|
| 132 |
+
# Échantillonnage
|
| 133 |
+
sample_pixels = pixels[::50]
|
| 134 |
|
| 135 |
+
# Calcul de la couleur moyenne
|
| 136 |
+
avg_color = np.mean(sample_pixels, axis=0)
|
| 137 |
+
return get_color_name(avg_color)
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
+
except:
|
| 140 |
+
return "Couleur indéterminée"
|
| 141 |
|
| 142 |
def classify_clothing(image):
|
| 143 |
+
"""Classification précise avec IA réelle"""
|
| 144 |
try:
|
| 145 |
if image is None:
|
| 146 |
return "❌ Veuillez uploader une image de vêtement"
|
| 147 |
|
| 148 |
+
# Chargement du modèle
|
| 149 |
+
model = load_model()
|
| 150 |
+
if model is None:
|
| 151 |
+
return "❌ Modèle IA non disponible"
|
| 152 |
|
| 153 |
+
# Conversion de l'image
|
| 154 |
+
if isinstance(image, str):
|
| 155 |
+
pil_image = Image.open(image).convert('RGB')
|
| 156 |
+
else:
|
| 157 |
+
pil_image = image.convert('RGB')
|
| 158 |
+
|
| 159 |
+
# 🔥 ANALYSE AVEC L'IA
|
| 160 |
+
ai_results = analyze_with_ai(pil_image, model)
|
| 161 |
+
|
| 162 |
+
if not ai_results:
|
| 163 |
+
return "❌ Impossible d'analyser l'image"
|
| 164 |
+
|
| 165 |
+
# 🎨 DÉTECTION COULEUR
|
| 166 |
+
dominant_color = get_dominant_color_from_image(pil_image)
|
| 167 |
|
| 168 |
+
# 📊 RÉSULTAT PRINCIPAL
|
| 169 |
+
main_result = ai_results[0]
|
| 170 |
+
|
| 171 |
+
output = f"""## 🎯 ANALYSE IA DU VÊTEMENT
|
| 172 |
|
| 173 |
+
### 🔍 RÉSULTAT PRINCIPAL:
|
| 174 |
+
**{main_result['name']} {dominant_color}** - {main_result['score']:.1f}% de confiance
|
| 175 |
|
| 176 |
+
### 📊 DÉTAILS DE L'ANALYSE:
|
| 177 |
+
• **Type détecté:** {main_result['name']}
|
| 178 |
+
• **Couleur dominante:** {dominant_color}
|
| 179 |
+
• **Précision IA:** {main_result['score']:.1f}%
|
| 180 |
|
| 181 |
+
### 🎯 FIABILITÉ:
|
| 182 |
+
{"🔒 Très haute confiance" if main_result['score'] > 70 else "🔍 Bonne confiance" if main_result['score'] > 50 else "⚠️ Confiance modérée"}
|
| 183 |
|
| 184 |
+
### 💡 CONSEILS:
|
| 185 |
+
• Photo nette et bien cadrée
|
| 186 |
+
• Fond uni pour meilleure précision
|
| 187 |
+
• Éclairage uniforme
|
| 188 |
"""
|
| 189 |
+
|
| 190 |
+
# 📈 RÉSULTATS SECONDAIRES (seulement si significatifs)
|
| 191 |
+
if len(ai_results) > 1 and ai_results[1]['score'] > 15:
|
| 192 |
+
output += f"\n### 🔍 AUTRES POSSIBILITÉS:\n"
|
| 193 |
+
for i, result in enumerate(ai_results[1:3], 2):
|
| 194 |
+
if result['score'] > 10:
|
| 195 |
+
output += f"• {result['name']} - {result['score']:.1f}%\n"
|
| 196 |
+
|
| 197 |
return output
|
| 198 |
|
| 199 |
except Exception as e:
|
| 200 |
return f"❌ Erreur d'analyse: {str(e)}"
|
| 201 |
|
| 202 |
# 🎨 INTERFACE SIMPLIFIÉE
|
| 203 |
+
with gr.Blocks(title="Reconnaissance IA de Vêtements", theme=gr.themes.Soft()) as demo:
|
| 204 |
|
| 205 |
gr.Markdown("""
|
| 206 |
+
# 🤖 RECONNAISSANCE IA DE VÊTEMENTS
|
| 207 |
+
*Analyse précise par intelligence artificielle*
|
| 208 |
""")
|
| 209 |
|
| 210 |
with gr.Row():
|
| 211 |
with gr.Column(scale=1):
|
| 212 |
gr.Markdown("### 📤 UPLOADER UN VÊTEMENT")
|
| 213 |
image_input = gr.Image(
|
| 214 |
+
type="pil",
|
| 215 |
+
label="Sélectionnez votre vêtement",
|
| 216 |
height=300,
|
| 217 |
sources=["upload"],
|
| 218 |
)
|
| 219 |
|
| 220 |
gr.Markdown("""
|
| 221 |
+
### 🎯 POUR DE MEILLEURS RÉSULTATS:
|
| 222 |
✅ **Un vêtement à la fois**
|
| 223 |
+
✅ **Photo nette et centrée**
|
| 224 |
✅ **Fond uni de préférence**
|
| 225 |
✅ **Bon éclairage**
|
| 226 |
+
⏱️ **Analyse en 2-3 secondes**
|
| 227 |
""")
|
| 228 |
|
| 229 |
+
analyze_btn = gr.Button("🤖 Analyser avec IA", variant="primary")
|
| 230 |
+
clear_btn = gr.Button("🧹 Effacer", variant="secondary")
|
| 231 |
|
| 232 |
with gr.Column(scale=2):
|
| 233 |
+
gr.Markdown("### 📊 RAPPORT IA DÉTAILLÉ")
|
| 234 |
output_text = gr.Markdown(
|
| 235 |
+
value="⬅️ Uploader un vêtement pour l'analyse IA"
|
| 236 |
)
|
| 237 |
|
| 238 |
# 🎮 INTERACTIONS
|
|
|
|
| 248 |
outputs=[image_input, output_text]
|
| 249 |
)
|
| 250 |
|
|
|
|
| 251 |
image_input.upload(
|
| 252 |
fn=classify_clothing,
|
| 253 |
inputs=[image_input],
|
|
|
|
| 259 |
demo.launch(
|
| 260 |
server_name="0.0.0.0",
|
| 261 |
server_port=7860,
|
| 262 |
+
share=False
|
|
|
|
| 263 |
)
|