Chao Xu
commited on
Commit
•
d61fd21
1
Parent(s):
fc96ff2
update sam ckpt path
Browse files- sam_utils.py +4 -1
- sam_vit_h_4b8939.pth +3 -0
sam_utils.py
CHANGED
@@ -11,7 +11,10 @@ from utils import find_image_file
|
|
11 |
from segment_anything import sam_model_registry, SamPredictor, SamAutomaticMaskGenerator
|
12 |
|
13 |
def sam_init(device_id=0):
|
14 |
-
|
|
|
|
|
|
|
15 |
model_type = "vit_h"
|
16 |
|
17 |
device = "cuda:{}".format(device_id) if torch.cuda.is_available() else "cpu"
|
|
|
11 |
from segment_anything import sam_model_registry, SamPredictor, SamAutomaticMaskGenerator
|
12 |
|
13 |
def sam_init(device_id=0):
|
14 |
+
import inspect
|
15 |
+
dir_path = os.path.dirname(os.path.abspath(
|
16 |
+
inspect.getfile(inspect.currentframe())))
|
17 |
+
sam_checkpoint = os.path.join(dir_path, "sam_vit_h_4b8939.pth")
|
18 |
model_type = "vit_h"
|
19 |
|
20 |
device = "cuda:{}".format(device_id) if torch.cuda.is_available() else "cpu"
|
sam_vit_h_4b8939.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a7bf3b02f3ebf1267aba913ff637d9a2d5c33d3173bb679e46d9f338c26f262e
|
3 |
+
size 2564550879
|