Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,6 @@ sys.path.append(os.path.join(os.getcwd(), "GroundingDINO"))
|
|
| 17 |
sys.path.append(os.path.join(os.getcwd(), "segment_anything"))
|
| 18 |
os.system("wget https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swinb_cogcoor.pth")
|
| 19 |
os.system("wget https://huggingface.co/spaces/mrtlive/segment-anything-model/resolve/main/sam_vit_h_4b8939.pth")
|
| 20 |
-
|
| 21 |
import torchvision
|
| 22 |
from GroundingDINO.groundingdino.util.inference import load_model
|
| 23 |
from segment_anything import build_sam, SamPredictor
|
|
@@ -25,7 +24,8 @@ import spaces
|
|
| 25 |
import GroundingDINO.groundingdino.datasets.transforms as T
|
| 26 |
from GroundingDINO.groundingdino.util.utils import clean_state_dict, get_phrases_from_posmap
|
| 27 |
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
# GroundingDINO config and checkpoint
|
| 31 |
GROUNDING_DINO_CONFIG_PATH = "./GroundingDINO_SwinB.cfg.py"
|
|
|
|
| 17 |
sys.path.append(os.path.join(os.getcwd(), "segment_anything"))
|
| 18 |
os.system("wget https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swinb_cogcoor.pth")
|
| 19 |
os.system("wget https://huggingface.co/spaces/mrtlive/segment-anything-model/resolve/main/sam_vit_h_4b8939.pth")
|
|
|
|
| 20 |
import torchvision
|
| 21 |
from GroundingDINO.groundingdino.util.inference import load_model
|
| 22 |
from segment_anything import build_sam, SamPredictor
|
|
|
|
| 24 |
import GroundingDINO.groundingdino.datasets.transforms as T
|
| 25 |
from GroundingDINO.groundingdino.util.utils import clean_state_dict, get_phrases_from_posmap
|
| 26 |
|
| 27 |
+
os.environ["HF_HUB_DISABLE_XET"] = "1"
|
| 28 |
+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
| 29 |
|
| 30 |
# GroundingDINO config and checkpoint
|
| 31 |
GROUNDING_DINO_CONFIG_PATH = "./GroundingDINO_SwinB.cfg.py"
|