Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 936 Bytes

File metadata and controls

36 lines (23 loc) · 936 Bytes

BackgroundErase API Python Integration

Python wrapper for the BackgroundErase API.

Installation

git clone https://github.com/PramaLLC/ben-api-python-integration
cd ben-api-python-integration
pip install -r requirements.txt

Generate API Key

You 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'.

Example

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")

API documentation

For full API documentation visit: https://backgrounderase.com/docs