Spaces:
Sleeping
Sleeping
Download app.py from Beasto/HumanSegmentation: direct link, hf CLI and curl.
- Browser
- Download file 456 Bytes
-
https://huggingface.co/spaces/Beasto/HumanSegmentation/resolve/main/app.py
- Command line
-
hf download hf://spaces/Beasto/HumanSegmentation/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Beasto/HumanSegmentation/resolve/main/app.py
456 Bytes
| from PIL import Image,ImageDraw,ImageFont | |
| import numpy as np | |
| from ultralytics import YOLO | |
| import streamlit as st | |
| model = YOLO('HumanSegmentation.pt') | |
| img = st.file_uploader('Choose an Image') | |
| if img is not None: | |
| img = Image.open(img).resize((640,640)).convert('RGB') | |
| results = model(img) | |
| st.image(img,'Input') | |
| for result in results: | |
| for mask in result.masks.data: | |
| mask = mask.numpy() | |
| st.image(mask,'Mask') | |