sd
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from transformers import SamModel, SamProcessor
|
|
6 |
import io
|
7 |
import base64
|
8 |
import torch
|
|
|
9 |
|
10 |
app = FastAPI(title="SAM-ViT-Base API")
|
11 |
|
@@ -58,4 +59,7 @@ async def segment_image(file: UploadFile = File(...)):
|
|
58 |
|
59 |
@app.get("/")
|
60 |
async def root():
|
61 |
-
return {"message": "SAM-ViT-Base API çalışıyor. /segment endpoint'ine görüntü yükleyin."}
|
|
|
|
|
|
|
|
6 |
import io
|
7 |
import base64
|
8 |
import torch
|
9 |
+
import uvicorn
|
10 |
|
11 |
app = FastAPI(title="SAM-ViT-Base API")
|
12 |
|
|
|
59 |
|
60 |
@app.get("/")
|
61 |
async def root():
|
62 |
+
return {"message": "SAM-ViT-Base API çalışıyor. /segment endpoint'ine görüntü yükleyin."}
|
63 |
+
|
64 |
+
if __name__ == "__main__":
|
65 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|