Spaces:
Running
on
T4
Running
on
T4
Commit
·
e0271c3
1
Parent(s):
331be04
ms
Browse files
main.py
CHANGED
@@ -20,10 +20,11 @@ model_type = "vit_l"
|
|
20 |
sam = sam_model_registry[model_type](checkpoint=checkpoint)
|
21 |
sam.to(device='cuda')
|
22 |
predictor = SamPredictor(sam)
|
|
|
23 |
|
24 |
@app.route('/')
|
25 |
def hello():
|
26 |
-
return {"hei": "
|
27 |
|
28 |
@app.route('/health', methods=['GET'])
|
29 |
def health_check():
|
@@ -32,7 +33,8 @@ def health_check():
|
|
32 |
|
33 |
@app.route('/get-npy')
|
34 |
def get_npy():
|
35 |
-
try:
|
|
|
36 |
# Get the 'img_url' from the query parameters
|
37 |
img_url = request.args.get('img_url', '') # Default to empty string if not provided
|
38 |
|
|
|
20 |
sam = sam_model_registry[model_type](checkpoint=checkpoint)
|
21 |
sam.to(device='cuda')
|
22 |
predictor = SamPredictor(sam)
|
23 |
+
print('Setup SAM model')
|
24 |
|
25 |
@app.route('/')
|
26 |
def hello():
|
27 |
+
return {"hei": "Malevolent Shrine :D"}
|
28 |
|
29 |
@app.route('/health', methods=['GET'])
|
30 |
def health_check():
|
|
|
33 |
|
34 |
@app.route('/get-npy')
|
35 |
def get_npy():
|
36 |
+
try:
|
37 |
+
print('received image from frontend')
|
38 |
# Get the 'img_url' from the query parameters
|
39 |
img_url = request.args.get('img_url', '') # Default to empty string if not provided
|
40 |
|