Spaces:
Build error
Build error
Trang Dang
commited on
Commit
·
29f785c
1
Parent(s):
4e3f3b8
adjust size
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def server(input: Inputs, output: Outputs, session: Session):
|
|
34 |
def image():
|
35 |
if input.image_input():
|
36 |
src = input.image_input()[0]['datapath']
|
37 |
-
img = {"src": src, "width": "
|
38 |
return img
|
39 |
return None
|
40 |
|
|
|
34 |
def image():
|
35 |
if input.image_input():
|
36 |
src = input.image_input()[0]['datapath']
|
37 |
+
img = {"src": src, "width": "500px"}
|
38 |
return img
|
39 |
return None
|
40 |
|
run.py
CHANGED
@@ -12,7 +12,7 @@ def pred(src):
|
|
12 |
|
13 |
# Create an instance of the model architecture with the loaded configuration
|
14 |
my_sam_model = SamModel(config=model_config)
|
15 |
-
#
|
16 |
my_sam_model.load_state_dict(torch.load("sam_model.pth", map_location=torch.device('cpu')))
|
17 |
|
18 |
new_image = np.array(Image.open(src).convert("RGB"))
|
|
|
12 |
|
13 |
# Create an instance of the model architecture with the loaded configuration
|
14 |
my_sam_model = SamModel(config=model_config)
|
15 |
+
#Update the model by loading the weights from saved file
|
16 |
my_sam_model.load_state_dict(torch.load("sam_model.pth", map_location=torch.device('cpu')))
|
17 |
|
18 |
new_image = np.array(Image.open(src).convert("RGB"))
|