developer0hye commited on
Commit
55b6378
·
verified ·
1 Parent(s): 014228c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
-
3
  import argparse
4
  import cv2
5
  from PIL import Image
@@ -23,6 +23,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
23
  processor = AutoProcessor.from_pretrained(model_id)
24
  model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)
25
 
 
26
  def run_grounding(input_image, grounding_caption, box_threshold, text_threshold):
27
  # Convert numpy array to PIL Image if needed
28
  if isinstance(input_image, np.ndarray):
 
1
  import gradio as gr
2
+ import spaces
3
  import argparse
4
  import cv2
5
  from PIL import Image
 
23
  processor = AutoProcessor.from_pretrained(model_id)
24
  model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)
25
 
26
+ @spaces.GPU
27
  def run_grounding(input_image, grounding_caption, box_threshold, text_threshold):
28
  # Convert numpy array to PIL Image if needed
29
  if isinstance(input_image, np.ndarray):