Download app.py from JahDaGanj/TO: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/spaces/JahDaGanj/TO/resolve/main/app.py
- Command line
-
hf download hf://spaces/JahDaGanj/TO/app.py
-
curl -L -o app.py https://huggingface.co/spaces/JahDaGanj/TO/resolve/main/app.py
592 Bytes
| import streamlit as st | |
| import numpy as np | |
| import cv2 | |
| from PIL import Image | |
| import torch | |
| import torchvision.transforms as T | |
| from torchvision.models.segmentation import deeplabv3_resnet101 | |
| from io import BytesIO | |
| st.set_page_config(page_title="Kleidung umfärben", layout="centered") | |
| st.title("🧥 Kleidung umfärben – Color Changer") | |
| uploaded_file = st.file_uploader("📤 Bild hochladen", type=["jpg", "jpeg", "png"]) | |
| def load_model(): | |
| model = deeplabv3_resnet101(pretrained=True).eval() | |
| return model | |
| def segment_clothes(img_pil): | |
| transform = T.Compose([ | |