Spaces:
Paused
Paused
VINU NAYAK commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,4 @@
|
|
| 1 |
-
|
| 2 |
-
from fastapi import FastAPI, UploadFile, File
|
| 3 |
-
from fastapi.responses import StreamingResponse
|
| 4 |
-
from rembg import remove
|
| 5 |
-
import io
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
@app.post("/remove-bg")
|
| 10 |
-
async def remove_bg(file: UploadFile = File(...)):
|
| 11 |
-
input_image = await file.read()
|
| 12 |
-
output_image = remove(input_image)
|
| 13 |
-
return StreamingResponse(io.BytesIO(output_image), media_type="image/png")
|
|
|
|
| 1 |
+
from app.main import app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
# This file is needed for Hugging Face Spaces compatibility
|
| 4 |
+
# The app is imported from app.main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|