Spaces:
Runtime error
Runtime error
cyk
commited on
Commit
·
cfa61ba
1
Parent(s):
32faf2b
SAA+
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ os.system('pip install -e .')
|
|
| 6 |
os.chdir('../SAM')
|
| 7 |
os.system('pip install -e .')
|
| 8 |
os.system('pip install opencv-python pycocotools matplotlib onnxruntime onnx ipykernel gradio loguru')
|
|
|
|
| 9 |
|
| 10 |
os.chdir('..')
|
| 11 |
os.mkdir('weights')
|
|
@@ -23,10 +24,6 @@ import SAA as SegmentAnyAnomaly
|
|
| 23 |
from utils.training_utils import *
|
| 24 |
import os
|
| 25 |
|
| 26 |
-
gpu_id = 0
|
| 27 |
-
|
| 28 |
-
os.environ['CURL_CA_BUNDLE'] = ''
|
| 29 |
-
os.environ['CUDA_VISIBLE_DEVICES'] = f"{gpu_id}"
|
| 30 |
|
| 31 |
|
| 32 |
dino_config_file = 'GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py'
|
|
@@ -35,7 +32,7 @@ sam_checkpoint = 'weights/sam_vit_h_4b8939.pth'
|
|
| 35 |
box_threshold = 0.1
|
| 36 |
text_threshold = 0.1
|
| 37 |
eval_resolution = 1024
|
| 38 |
-
device = f"
|
| 39 |
root_dir = 'result'
|
| 40 |
|
| 41 |
# get the model
|
|
|
|
| 6 |
os.chdir('../SAM')
|
| 7 |
os.system('pip install -e .')
|
| 8 |
os.system('pip install opencv-python pycocotools matplotlib onnxruntime onnx ipykernel gradio loguru')
|
| 9 |
+
os.system('pip install torch==1.10.0 torchvision==0.11.1 -f https://download.pytorch.org/whl/cu113/torch_stable.html')
|
| 10 |
|
| 11 |
os.chdir('..')
|
| 12 |
os.mkdir('weights')
|
|
|
|
| 24 |
from utils.training_utils import *
|
| 25 |
import os
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
dino_config_file = 'GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py'
|
|
|
|
| 32 |
box_threshold = 0.1
|
| 33 |
text_threshold = 0.1
|
| 34 |
eval_resolution = 1024
|
| 35 |
+
device = f"cpu"
|
| 36 |
root_dir = 'result'
|
| 37 |
|
| 38 |
# get the model
|