Martin Tomov commited on
Commit
08d4b40
Β·
verified Β·
1 Parent(s): a9add2e

ZeroGPU @spaces.GPU

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -18,6 +18,8 @@ except ImportError:
18
  os.system('pip install transformers')
19
  os.system('pip install git+https://github.com/IDEA-Research/Grounded-Segment-Anything.git')
20
 
 
 
21
  import gradio as gr
22
  import json
23
  import numpy as np
@@ -26,6 +28,7 @@ from yolo_utils import yolo_processimage
26
  from detectron_utils import detectron_process_image
27
  from gsl_utils import gsl_process_image
28
 
 
29
  def process_image(image, include_json):
30
  detectron_result = detectron_process_image(image)
31
  yolo_result = yolo_processimage(image)
@@ -54,4 +57,4 @@ gr.Interface(
54
  ],
55
  title="Insect Model Zoo πŸžπŸ”¬",
56
  examples=examples
57
- ).launch()
 
18
  os.system('pip install transformers')
19
  os.system('pip install git+https://github.com/IDEA-Research/Grounded-Segment-Anything.git')
20
 
21
+ import os
22
+ import spaces
23
  import gradio as gr
24
  import json
25
  import numpy as np
 
28
  from detectron_utils import detectron_process_image
29
  from gsl_utils import gsl_process_image
30
 
31
+ @spaces.GPU
32
  def process_image(image, include_json):
33
  detectron_result = detectron_process_image(image)
34
  yolo_result = yolo_processimage(image)
 
57
  ],
58
  title="Insect Model Zoo πŸžπŸ”¬",
59
  examples=examples
60
+ ).launch()