File size: 2,094 Bytes
c7159bc
 
f11bcb7
0560780
 
c7159bc
f11bcb7
c7159bc
 
 
 
 
f11bcb7
 
 
 
 
c7159bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f11bcb7
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
---
title: AI Virtual Garment Ironing System
emoji: πŸš€
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 6.18.0
app_file: app.py
pinned: false
license: mit
short_description: Upload a photo β€” AI removes wrinkles from your clothing
tags:
- computer-vision
- image-segmentation
- garment-processing
- fashion-ai
- wrinkle-removal
---
# πŸ‘” AI Virtual Garment Ironing System

An AI-powered application that detects, segments, and virtually irons clothing in photographs.

## What it does

Upload a photo of yourself wearing clothes. The system will:

1. **Segment** the garment from the background using SegFormer
2. **Detect** wrinkles using multi-scale edge analysis + a CNN
3. **Iron** targeted wrinkle zones using fabric-aware, luminance-only smoothing
4. **Preserve** logos, patterns, face, background, lighting, and structural folds
5. **Show** a before/after comparison and detailed analysis report

## Features

- Adjustable ironing intensity (Light / Medium / Professional Press)
- Fabric-specific processing (Cotton, Linen, Silk, Denim, Polyester, Wool)
- Clothing type hints for better segmentation
- Wrinkle heatmap visualisation
- Batch processing
- Detailed analysis report per image

## Supported garments

Shirts, t-shirts, blouses, trousers, dresses, jackets, blazers, sarees, kurtas, and more.

## Running locally

```bash
git clone https://huggingface.co/spaces/your-username/garment-ironing
cd garment-ironing
pip install -r requirements.txt
python app.py
```

Open http://localhost:7860 in your browser.

## Technical stack

| Component | Technology |
|-----------|-----------|
| Garment segmentation | SegFormer (mattmdjaga/segformer_b2_clothes) |
| Wrinkle detection | Multi-scale Canny + Gabor + custom CNN |
| Ironing | Targeted bilateral/median smoothing + luminance correction |
| UI | Gradio 4.x |

The deterministic ironing path is used by default on both CPU and GPU because
it preserves garment identity, logos, color, skin, and background. Diffusion
inpainting remains an explicit opt-in for experimentation.

## License

MIT β€” free to use and modify.