mirror of
https://git.mirrors.martin98.com/https://github.com/danielgatis/rembg
synced 2025-08-17 18:05:56 +08:00
Update README.md
This commit is contained in:
parent
b8e0812497
commit
3558a53d1f
15
README.md
15
README.md
@ -84,9 +84,10 @@ Also you can send the file as a FormData (multipart/form-data):
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Usage as a library
|
### Usage as a library
|
||||||
Examples:
|
|
||||||
1. In `app.py`
|
|
||||||
|
|
||||||
|
#### Example 1: Read from stdin and write to stdout
|
||||||
|
|
||||||
|
In `app.py`
|
||||||
```python
|
```python
|
||||||
import sys
|
import sys
|
||||||
from rembg.bg import remove
|
from rembg.bg import remove
|
||||||
@ -99,7 +100,10 @@ Examples:
|
|||||||
cat input.png | python app.py > out.png
|
cat input.png | python app.py > out.png
|
||||||
```
|
```
|
||||||
|
|
||||||
2. ```python
|
#### Example 2: Using PIL
|
||||||
|
|
||||||
|
In `app.py`
|
||||||
|
```python
|
||||||
from rembg.bg import remove
|
from rembg.bg import remove
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import io
|
import io
|
||||||
@ -114,6 +118,11 @@ Examples:
|
|||||||
img.save(output_path)
|
img.save(output_path)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Then run
|
||||||
|
```
|
||||||
|
python app.py
|
||||||
|
```
|
||||||
|
|
||||||
### Usage as a docker
|
### Usage as a docker
|
||||||
|
|
||||||
Just run
|
Just run
|
||||||
|
Loading…
x
Reference in New Issue
Block a user