Skip to content

Commit

Permalink
Update USAGE.md (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihirv authored Dec 16, 2023
1 parent e44661a commit be319d3
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit be319d3

Please sign in to comment.