Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds usage example for multi image processing #553

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ session = new_session(model_name)
output = remove(input, session=session)
```

### For processing multiple image files
By default, `remove` initialises a new session every call. This can be a large bottleneck if you're having to process multiple images. Initialise a session and pass it in to the `remove` function for fast multi-image support
```python
model_name = "unet"
rembg_session = new_session(model_name)
for img in images:
output = remove(img, session=rembg_session)
```


### With alpha metting
Alpha metting is a post processing step that can be used to improve the quality of the output.
```python
Expand Down