Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,11 +8,13 @@ import torch
|
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
| 11 |
-
# Load the RMBG V1.4 model and processor
|
| 12 |
model = AutoModelForImageSegmentation.from_pretrained(
|
| 13 |
"briaai/RMBG-1.4", trust_remote_code=True
|
| 14 |
)
|
| 15 |
-
processor = AutoProcessor.from_pretrained(
|
|
|
|
|
|
|
| 16 |
|
| 17 |
@app.post("/remove-background")
|
| 18 |
async def remove_background(file: UploadFile = File(...)):
|
|
|
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
| 11 |
+
# Load the RMBG V1.4 model and processor with trust_remote_code=True
|
| 12 |
model = AutoModelForImageSegmentation.from_pretrained(
|
| 13 |
"briaai/RMBG-1.4", trust_remote_code=True
|
| 14 |
)
|
| 15 |
+
processor = AutoProcessor.from_pretrained(
|
| 16 |
+
"briaai/RMBG-1.4", trust_remote_code=True
|
| 17 |
+
)
|
| 18 |
|
| 19 |
@app.post("/remove-background")
|
| 20 |
async def remove_background(file: UploadFile = File(...)):
|