onuralpszr commited on
Commit
8d92093
·
verified ·
1 Parent(s): 344bc31

feat: ✨ space library added

Browse files

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>

Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,6 +8,7 @@ import cv2
8
  import numpy as np
9
  from PIL import Image
10
  import gradio as gr
 
11
 
12
  BOX_ANNOTATOR = sv.BoxAnnotator()
13
  LABEL_ANNOTATOR = sv.LabelAnnotator()
@@ -21,7 +22,7 @@ model = PaliGemmaForConditionalGeneration.from_pretrained(model_id).eval().to(DE
21
  processor = PaliGemmaProcessor.from_pretrained(model_id)
22
 
23
 
24
-
25
  def process_image(input_image,input_text,class_names):
26
  class_list = class_names.split(',')
27
  cv_image = cv2.cvtColor(np.array(input_image), cv2.COLOR_RGB2BGR)
 
8
  import numpy as np
9
  from PIL import Image
10
  import gradio as gr
11
+ import space
12
 
13
  BOX_ANNOTATOR = sv.BoxAnnotator()
14
  LABEL_ANNOTATOR = sv.LabelAnnotator()
 
22
  processor = PaliGemmaProcessor.from_pretrained(model_id)
23
 
24
 
25
+ @spaces.GPU
26
  def process_image(input_image,input_text,class_names):
27
  class_list = class_names.split(',')
28
  cv_image = cv2.cvtColor(np.array(input_image), cv2.COLOR_RGB2BGR)