sezer91 commited on
Commit
7410721
·
1 Parent(s): 8afbe19
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -5,6 +5,7 @@ import numpy as np
5
  from transformers import SamModel, SamProcessor
6
  import io
7
  import base64
 
8
 
9
  app = FastAPI(title="SAM-ViT-Base API")
10
 
@@ -45,4 +46,7 @@ async def segment_image(file: UploadFile = File(...)):
45
 
46
  @app.get("/")
47
  async def root():
48
- return {"message": "SAM-ViT-Base API çalışıyor. /segment endpoint'ine görüntü yükleyin."}
 
 
 
 
5
  from transformers import SamModel, SamProcessor
6
  import io
7
  import base64
8
+ import uvicorn
9
 
10
  app = FastAPI(title="SAM-ViT-Base API")
11
 
 
46
 
47
  @app.get("/")
48
  async def root():
49
+ return {"message": "SAM-ViT-Base API çalışıyor. /segment endpoint'ine görüntü yükleyin."}
50
+
51
+ if __name__ == "__main__":
52
+ uvicorn.run(app, host="0.0.0.0", port=7860)