Spaces:
Sleeping
Sleeping
| title: Garment Attribute Predictor | |
| emoji: 👕 | |
| colorFrom: indigo | |
| colorTo: blue | |
| sdk: gradio | |
| sdk_version: 5.25.2 | |
| app_file: app.py | |
| pinned: true | |
| # 👕 Fashion Attribute Predictor | |
| Ein Gradio-basierter Hugging Face Space zur Vorhersage von Attributen aus Modebildern (z. B. T-Shirts, Pullover, etc.) | |
| Das Modell sagt für jede Attributgruppe (z. B. Farbe, Material, Schnitt) **das wahrscheinlichste Merkmal** vorher – inklusive **Confidence-Score**. | |
| --- | |
| ## 🔍 Funktionen | |
| - 📸 Unterstützung für Bild-Upload | |
| - 🧠 Vorhersage von Attributen aus 228 Kategorien | |
| - 📊 Strukturierte **JSON-Ausgabe** mit `label`, `score` und `confidence` | |
| - ✅ Einfache Integration in Datenbanken, APIs oder Forschungsprojekte | |
| --- | |
| ## 🧩 Unterstützte Attributgruppen | |
| Das Modell liefert jeweils **das wahrscheinlichste Attribut** aus jeder dieser Gruppen: | |
| | Attributgruppe | Beschreibung (Beispiele) | | |
| |----------------|-------------------------------------------------| | |
| | `category` | Kleidungstyp (z. B. T-Shirts, Jeans, Blazer) | | |
| | `color` | Farbton (z. B. Red, Black, Blue) | | |
| | `material` | Materialtyp (z. B. Cotton, Leather, Lace) | | |
| | `style` | Stil (z. B. Vintage, Bandage, Peplum) | | |
| | `pattern` | Muster (z. B. Striped, Polka Dot, Floral) | | |
| | `sleeve` | Ärmeltyp (z. B. Sleeveless, Long Sleeves) | | |
| | `neckline` | Ausschnittform (z. B. V-Neck, Round Neck) | | |
| | `gender` | Gender-Zielgruppe (Male, Female, Neutral) | | |
| --- | |
| ## 📦 Ausgabeformat (Beispiel) | |
| ```json | |
| { | |
| "category": { | |
| "label": "T-Shirts", | |
| "score": 0.9123, | |
| "confidence": "high" | |
| }, | |
| "color": { | |
| "label": "Red", | |
| "score": 0.4871, | |
| "confidence": "low" | |
| } | |
| } | |
| ``` | |
| - **score**: Modellwahrscheinlichkeit (0.0–1.0) | |
| - **confidence**: `"high"` wenn Score ≥ 0.5, sonst `"low"` | |
| --- | |
| ## 📁 Dateien | |
| | Datei | Beschreibung | | |
| |-----------------------------|--------------| | |
| | `app.py` | Haupt-Interface mit JSON-Ausgabe | | |
| | `model_loader.py` | Lädt das trainierte ResNet50-Modell | | |
| | `index_to_attr.py` | Mapping von Indizes zu Attributnamen | | |
| | `model/AttrPredModel_StateDict.pth` | Vorgefertigte Modellgewichte | | |
| --- | |
| ## ⚙️ Modell-Details | |
| - Backbone: `ResNet50` | |
| - Trainingsdaten: iMaterialist (Fashion) Challenge 2018 | |
| - Vorhersageformat: Multi-Label (228 binäre Attribute) | |
| - Eingabegröße: 512×512 RGB | |
| - Normalisierung: mean=[0.6765, 0.6347, 0.6207], std=[0.3284, 0.3371, 0.3379] | |
| --- | |
| ## 📚 Lizenz & Nutzung | |
| Nur für nicht-kommerzielle Forschungszwecke. | |
| Modelldaten basieren auf öffentlich verfügbaren Wettbewerbsdaten von FGVC5/Kaggle. | |
| --- | |
| ## 🧑💻 Erstellt von | |
| Andreas Jewtschuk | |
| Masterarbeit – E-Commerce, Ernst-Abbe-Hochschule Jena | |
| [2025] | |
| --- | |
| ## 📥 Modellquelle | |
| Dieses Projekt basiert auf dem vortrainierten Modell aus: | |
| **VisualFashionAttributePrediction** | |
| by [Malte Prinzler](https://github.com/malteprinzler) | |
| 🔗 https://github.com/malteprinzler/VisualFashionAttributePrediction | |
| Das Modell wurde ursprünglich im Rahmen der [iMaterialist Challenge (Fashion) 2018](https://www.kaggle.com/competitions/imaterialist-challenge-fashion-2018/) trainiert und basiert auf einem ResNet50-Backbone. | |
| --- | |
| ## 🔧 Modifikationen durch den Autor | |
| Im Rahmen dieser Anwendung wurde ausschließlich die **Ausgabe der Attributvorhersagen** verändert: | |
| - Ursprünglich wurden nur Attribute mit einem Score über 0.5 angezeigt. | |
| - In dieser Version wird **für jede Attributgruppe** (z. B. Farbe, Material, Ärmel) das **wahrscheinlichste Attribut** angezeigt – unabhängig vom Score. | |
| - Zusätzlich wird eine Einschätzung über die Modellzuversicht (`confidence`: "high" / "low") auf Basis eines Schwellenwerts von 0.5 ausgegeben. | |
| Das Modell selbst wurde nicht verändert. | |