Spaces:
Running
on
Zero
Running
on
Zero
use smaller model to improve CUDA usage
Browse files- app.py +1 -1
- utils/florence.py +1 -1
- utils/sam.py +2 -2
app.py
CHANGED
@@ -166,4 +166,4 @@ with gr.Blocks() as demo:
|
|
166 |
]
|
167 |
)
|
168 |
|
169 |
-
demo.launch(debug=False, show_error=True
|
|
|
166 |
]
|
167 |
)
|
168 |
|
169 |
+
demo.launch(debug=False, show_error=True)
|
utils/florence.py
CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
|
|
7 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
8 |
from transformers.dynamic_module_utils import get_imports
|
9 |
|
10 |
-
FLORENCE_CHECKPOINT = "microsoft/Florence-2-
|
11 |
FLORENCE_OBJECT_DETECTION_TASK = '<OD>'
|
12 |
FLORENCE_DETAILED_CAPTION_TASK = '<MORE_DETAILED_CAPTION>'
|
13 |
FLORENCE_CAPTION_TO_PHRASE_GROUNDING_TASK = '<CAPTION_TO_PHRASE_GROUNDING>'
|
|
|
7 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
8 |
from transformers.dynamic_module_utils import get_imports
|
9 |
|
10 |
+
FLORENCE_CHECKPOINT = "microsoft/Florence-2-base"
|
11 |
FLORENCE_OBJECT_DETECTION_TASK = '<OD>'
|
12 |
FLORENCE_DETAILED_CAPTION_TASK = '<MORE_DETAILED_CAPTION>'
|
13 |
FLORENCE_CAPTION_TO_PHRASE_GROUNDING_TASK = '<CAPTION_TO_PHRASE_GROUNDING>'
|
utils/sam.py
CHANGED
@@ -7,8 +7,8 @@ from PIL import Image
|
|
7 |
from sam2.build_sam import build_sam2
|
8 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
9 |
|
10 |
-
SAM_CHECKPOINT = "checkpoints/
|
11 |
-
SAM_CONFIG = "
|
12 |
|
13 |
|
14 |
def load_sam_model(
|
|
|
7 |
from sam2.build_sam import build_sam2
|
8 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
9 |
|
10 |
+
SAM_CHECKPOINT = "checkpoints/sam2_hiera_small.pt"
|
11 |
+
SAM_CONFIG = "sam2_hiera_s.yaml"
|
12 |
|
13 |
|
14 |
def load_sam_model(
|