Spaces:
Runtime error
Runtime error
Download app.py from biennh/interior-segmentation: direct link, hf CLI and curl.
- Browser
- Download file 723 Bytes
-
https://huggingface.co/spaces/biennh/interior-segmentation/resolve/main/app.py
- Command line
-
hf download hf://spaces/biennh/interior-segmentation/app.py
-
curl -L -o app.py https://huggingface.co/spaces/biennh/interior-segmentation/resolve/main/app.py
723 Bytes
| import numpy as np | |
| import gradio as gr | |
| from model import SegmentationTool | |
| seg_tool = SegmentationTool() | |
| def segment(input_img, mask_items): | |
| mask_image, transparent_mask_image, image, items, room = ( | |
| seg_tool.get_mask(image=input_img, mask_items=mask_items)) | |
| return mask_image | |
| demo = gr.Interface(fn=segment, | |
| inputs=[ | |
| gr.Image(type='pil'), | |
| gr.CheckboxGroup([("Door", 14), ("Window", 8)], | |
| value=[8, 14], | |
| label="Mask Items")], | |
| outputs=['image'], | |
| allow_flagging='never') | |
| if __name__ == "__main__": | |
| demo.launch() | |