Spaces:
Paused
Paused
|
Download SETUP.md from TechAvenger/ClothIron: direct link, hf CLI and curl.
- Browser
- Download file 2.89 kB
-
https://huggingface.co/spaces/TechAvenger/ClothIron/resolve/main/SETUP.md
- Command line
-
hf download hf://spaces/TechAvenger/ClothIron/SETUP.md
-
curl -L -o SETUP.md https://huggingface.co/spaces/TechAvenger/ClothIron/resolve/main/SETUP.md
2.89 kB
| # Setup & Run Guide | |
| ## 1. PyCharm Setup | |
| ### Clone / open project | |
| 1. Open PyCharm β **File β Open** β select the `garment_ironing/` folder | |
| 2. PyCharm will detect `requirements.txt` automatically | |
| ### Create virtual environment | |
| In PyCharm terminal: | |
| ```bash | |
| python -m venv venv | |
| # Windows | |
| venv\Scripts\activate | |
| # macOS / Linux | |
| source venv/bin/activate | |
| pip install --upgrade pip | |
| pip install -r requirements.txt | |
| ``` | |
| ### Run configuration | |
| 1. **Run β Edit Configurations β + β Python** | |
| 2. Script: `app.py` | |
| 3. Working directory: project root | |
| 4. Click **Run** or press Shift+F10 | |
| The app opens at **http://localhost:7860** | |
| --- | |
| ## 2. Generate example images (first run only) | |
| ```bash | |
| python create_example_assets.py | |
| ``` | |
| --- | |
| ## 3. Train custom wrinkle model (optional) | |
| ```bash | |
| # Prepare your dataset in data/train/images, data/train/masks, data/val/... | |
| python train_wrinkle_model.py --data_dir data --epochs 50 --batch_size 8 | |
| ``` | |
| --- | |
| ## 4. Publish to HuggingFace Spaces | |
| ### Install HF CLI | |
| ```bash | |
| pip install huggingface_hub | |
| huggingface-cli login # paste your HF token | |
| ``` | |
| ### Create a new Space | |
| ```bash | |
| huggingface-cli repo create garment-ironing --type space --space_sdk gradio | |
| ``` | |
| ### Push all files | |
| ```bash | |
| cd garment_ironing | |
| git init | |
| git add . | |
| git commit -m "initial commit" | |
| git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/garment-ironing | |
| git push -u origin main | |
| ``` | |
| HuggingFace will automatically install `requirements.txt` and run `app.py`. | |
| --- | |
| ## 5. Environment variables (optional secrets) | |
| If you want to use private HF model weights, set in HF Space secrets: | |
| - `HF_TOKEN` β your HuggingFace token | |
| --- | |
| ## 6. GPU vs CPU behaviour | |
| | Hardware | Ironing method | Speed | | |
| |----------|---------------|-------| | |
| | NVIDIA GPU (β₯8 GB VRAM) | Stable Diffusion inpainting | ~10β30 s/image | | |
| | CPU only | Classical bilateral + guided filter | ~3β8 s/image | | |
| HuggingFace Spaces free tier runs on CPU. Upgrade to a GPU Space for SD inpainting. | |
| --- | |
| ## 7. File structure | |
| ``` | |
| garment_ironing/ | |
| βββ app.py β Gradio UI + entry point | |
| βββ requirements.txt | |
| βββ README.md β HuggingFace Spaces config + docs | |
| βββ train_wrinkle_model.py β Training script (run locally) | |
| βββ create_example_assets.py β Generate placeholder example images | |
| βββ assets/ β Example images for the UI | |
| βββ models/ | |
| β βββ __init__.py | |
| β βββ segmentation.py β SegFormer garment segmenter | |
| β βββ wrinkle_detector.py β Multi-scale wrinkle detection | |
| β βββ ironing_pipeline.py β Classical + SD inpainting ironer | |
| βββ utils/ | |
| βββ __init__.py | |
| βββ image_utils.py β Resize, compare, overlay helpers | |
| βββ analysis.py β Wrinkle scoring + report generation | |
| ``` | |