Python wrapper for the BackgroundErase API.
git clone https://github.com/PramaLLC/ben-api-python-integration
cd ben-api-python-integration
pip install -r requirements.txtYou must have an active business subscription which can be found at https://backgrounderase.com/pricing. To generate your API key navigate to https://backgrounderase.com/account and scroll to the 'API Access' section then press 'Generate Key'.
create example.py
from PIL import Image
from main import predict_image # import predict image function from repo
image = Image.open("image.jpg") # your image file path or pil image object
mask, foregorund = predict_image(image,"your_ben_api_token")
mask.save("mask.png")
foregorund.save("foreground.png")For full API documentation visit: https://backgrounderase.com/docs