Spaces:
Running
Running
Trang Dang
commited on
Commit
•
78054c9
1
Parent(s):
f2d8c06
use sam model without config
Browse files
run.py
CHANGED
@@ -6,13 +6,13 @@ import app
|
|
6 |
import os
|
7 |
|
8 |
def pred(src):
|
9 |
-
# Load the model configuration
|
10 |
# os.environ['HUGGINGFACE_HUB_HOME'] = './.cache'
|
11 |
-
|
12 |
-
|
|
|
13 |
|
14 |
# Create an instance of the model architecture with the loaded configuration
|
15 |
-
my_sam_model = SamModel(
|
16 |
#Update the model by loading the weights from saved file.
|
17 |
my_sam_model.load_state_dict(torch.load("sam_model.pth", map_location=torch.device('cpu')))
|
18 |
|
|
|
6 |
import os
|
7 |
|
8 |
def pred(src):
|
|
|
9 |
# os.environ['HUGGINGFACE_HUB_HOME'] = './.cache'
|
10 |
+
# Load the model configuration
|
11 |
+
# model_config = SamConfig.from_pretrained("facebook/sam-vit-base")
|
12 |
+
# processor = SamProcessor.from_pretrained("facebook/sam-vit-base")
|
13 |
|
14 |
# Create an instance of the model architecture with the loaded configuration
|
15 |
+
my_sam_model = SamModel()
|
16 |
#Update the model by loading the weights from saved file.
|
17 |
my_sam_model.load_state_dict(torch.load("sam_model.pth", map_location=torch.device('cpu')))
|
18 |
|