Image Segmentation
BEN2
ONNX
Safetensors
PyTorch
BEN2
background-remove
mask-generation
Dichotomous image segmentation
background remove
foreground
background
remove background
model_hub_mixin
pytorch_model_hub_mixin
background removal
background-removal
Instructions to use PramaLLC/BEN2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BEN2
How to use PramaLLC/BEN2 with BEN2:
import requests from PIL import Image from ben2 import AutoModel url = "https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg" image = Image.open(requests.get(url, stream=True).raw) model = AutoModel.from_pretrained("PramaLLC/BEN2") model.to("cuda").eval() foreground = model.inference(image) - Notebooks
- Google Colab
- Kaggle
Error during the model initialization
#1
by alexcardo - opened
AttributeError Traceback (most recent call last)
Cell In[6], line 1
----> 1 model = BEN2.BEN_Base().to(device).eval()
AttributeError: module 'BEN2' has no attribute 'BEN_Base'
Make sure you cd into the BEN2 folder. When you clone the repo, its name is BEN2, but the file you are trying to import is also named BEN2.
cd BEN2
pip install -r requirements.txt
python3 inference.py
MaxwellMeyer changed discussion status to closed