Compare commits

..

2 Commits

Author SHA1 Message Date
zjt
1b4cec53f5 cros 2023-12-18 10:06:41 +08:00
zjt
2aca3657ad fix 2023-12-18 10:05:33 +08:00

View File

@ -13,7 +13,7 @@ print(torch.cuda.is_available())
# checkpoint = "sam_vit_b_01ec64.pth"
print(time.time())
# set large model related configs
checkpoint = "sam_vit_h_4b8939.pth"
checkpoint = "notebooks/sam_vit_h_4b8939.pth"
model_type = "vit_h"
sam = sam_model_registry[model_type](checkpoint=checkpoint)
sam.to(device='cuda')
@ -51,9 +51,13 @@ def index():
np.save("array.npy", image_embedding)
response = Response(byte_io, mimetype="application/octet-stream")
response.headers["Content-Length"] = 4194432
response.headers["Access-Control-Allow-Origin"] = "*"
return response
else:
return 'Content-Type not supported!'
print('server starts working')
app.run('0.0.0.0', 2020, False)