merve HF staff commited on
Commit
fee2c8a
1 Parent(s): eb9c0c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,11 +5,11 @@ import gradio as gr
5
 
6
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
7
 
8
- owl_model = Owlv2ForObjectDetection.from_pretrained("google/owlv2-base-patch16-ensemble").to(device)
9
  owl_processor = Owlv2Processor.from_pretrained("google/owlv2-base-patch16-ensemble")
10
 
11
  dino_processor = AutoProcessor.from_pretrained("IDEA-Research/grounding-dino-base")
12
- dino_model = AutoModelForZeroShotObjectDetection.from_pretrained("IDEA-Research/grounding-dino-base").to(device)
13
 
14
  @spaces.GPU
15
  def infer(img, text_queries, score_threshold, model):
 
5
 
6
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
7
 
8
+ owl_model = Owlv2ForObjectDetection.from_pretrained("google/owlv2-base-patch16-ensemble").to("cuda")
9
  owl_processor = Owlv2Processor.from_pretrained("google/owlv2-base-patch16-ensemble")
10
 
11
  dino_processor = AutoProcessor.from_pretrained("IDEA-Research/grounding-dino-base")
12
+ dino_model = AutoModelForZeroShotObjectDetection.from_pretrained("IDEA-Research/grounding-dino-base").to("cuda")
13
 
14
  @spaces.GPU
15
  def infer(img, text_queries, score_threshold, model):