SkalskiP commited on
Commit
5ae5bca
1 Parent(s): 576e22a

use smaller model to improve CUDA usage

Browse files
Files changed (3) hide show
  1. app.py +1 -1
  2. utils/florence.py +1 -1
  3. 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, max_threads=1)
 
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-large"
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/sam2_hiera_large.pt"
11
- SAM_CONFIG = "sam2_hiera_l.yaml"
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(