fumucu commited on
Commit
af7e71c
·
1 Parent(s): 9a88c51

initial commit

Browse files
Files changed (2) hide show
  1. laod_pipeline.py +2 -0
  2. requirements.txt +2 -0
laod_pipeline.py CHANGED
@@ -3,6 +3,7 @@ from transformers import pipeline
3
  from transformers import AutoProcessor, AutoModelForZeroShotObjectDetection
4
  import numpy as np
5
  import draw_utils
 
6
 
7
  from huggingface_hub import login
8
  import os
@@ -30,6 +31,7 @@ model_id = "IDEA-Research/grounding-dino-tiny"
30
  processor = AutoProcessor.from_pretrained(model_id)
31
  model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)
32
 
 
33
  def laod_gdino(image):
34
  messages = [
35
  {
 
3
  from transformers import AutoProcessor, AutoModelForZeroShotObjectDetection
4
  import numpy as np
5
  import draw_utils
6
+ import spaces
7
 
8
  from huggingface_hub import login
9
  import os
 
31
  processor = AutoProcessor.from_pretrained(model_id)
32
  model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)
33
 
34
+ @spaces.GPU
35
  def laod_gdino(image):
36
  messages = [
37
  {
requirements.txt CHANGED
@@ -7,3 +7,5 @@ Pillow
7
  opencv-python
8
  huggingface-hub
9
  accelerate
 
 
 
7
  opencv-python
8
  huggingface-hub
9
  accelerate
10
+ spaces
11
+