Download examples/image.py from PramaLLC/BEN3: direct link, hf CLI and curl.
- Browser
- Download file 201 Bytes
-
https://huggingface.co/PramaLLC/BEN3/resolve/main/examples/image.py
- Command line
-
hf download hf://PramaLLC/BEN3/examples/image.py
-
curl -L -o image.py https://huggingface.co/PramaLLC/BEN3/resolve/main/examples/image.py
201 Bytes
| from PIL import Image | |
| from ben3 import BEN3 | |
| model = BEN3("ben3.pth", device="cuda") | |
| foreground, mask = model.inference(Image.open("input.jpg")) | |
| foreground.save("foreground.png") | |
| mask.save("mask.png") | |