Spaces:
Running
Running
yansong1616
commited on
Commit
•
a6ed08a
1
Parent(s):
f6a2175
Update SAM2/sam2/build_sam.py
Browse files- SAM2/sam2/build_sam.py +7 -1
SAM2/sam2/build_sam.py
CHANGED
@@ -68,7 +68,13 @@ def build_sam2_video_predictor(
|
|
68 |
|
69 |
|
70 |
import os
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
# Read config and init model
|
74 |
cfg = compose(config_name=config_file, overrides=hydra_overrides)
|
|
|
68 |
|
69 |
|
70 |
import os
|
71 |
+
# 获取配置文件的绝对路径
|
72 |
+
config_dir = os.path.join(os.path.dirname(__file__), 'sam2_configs')
|
73 |
+
|
74 |
+
# 确保配置目录存在
|
75 |
+
if not os.path.isdir(config_dir):
|
76 |
+
raise FileNotFoundError(f"Config directory {config_dir} does not exist!")
|
77 |
+
|
78 |
|
79 |
# Read config and init model
|
80 |
cfg = compose(config_name=config_file, overrides=hydra_overrides)
|